![]() |
VOOZH | about |
Adobe ColdFusion is a web and mobile application development platform. It uses its own scripting language, ColdFusion Markup Language (CFML), to create data-driven websites as well as generate remote services, such as REST.
When ColdFusion is paired with the CData JDBC Driver for Adobe Commerce, you can link your ColdFusion web and mobile applications to operational Adobe Commerce data. This allows for your applications to be more robust and complete. This article details how to use the JDBC driver to create a table populated with Adobe Commerce data from within a ColdFusion markup file.
With built-in optimized data processing, the CData JDBC Driver offers unmatched performance for interacting with live Adobe Commerce data. When you issue complex SQL queries to Adobe Commerce, the driver pushes supported SQL operations, like filters and aggregations, directly to Adobe Commerce and utilizes the embedded SQL engine to process unsupported operations client-side (often SQL functions and JOIN operations). Its built-in dynamic metadata querying allows you to work with and analyze Adobe Commerce data using native data types.
You will need a JDBC connection string to establish a connection between Coldfusion and Adobe Commerce.
Adobe Commerce uses the OAuth 1 authentication standard. To connect to the Adobe Commerce REST API, obtain values for the OAuthClientId, OAuthClientSecret, and CallbackURL connection properties by registering an app with your Adobe Commerce system. See the "Getting Started" section in the help documentation for a guide to obtaining the OAuth values and connecting.
You will also need to provide the URL to your Adobe Commerce system. The URL depends on whether you are using the Adobe Commerce REST API as a customer or administrator.
Customer: To use Adobe Commerce as a customer, make sure you have created a customer account in the Adobe Commerce homepage. To do so, click Account -> Register. You can then set the URL connection property to the endpoint of your Adobe Commerce system.
Administrator: To access Adobe Commerce as an administrator, set CustomAdminPath instead. This value can be obtained in the Advanced settings in the Admin menu, which can be accessed by selecting System -> Configuration -> Advanced -> Admin -> Admin Base URL.
If the Use Custom Admin Path setting on this page is set to YES, the value is inside the Custom Admin Path text box; otherwise, set the CustomAdminPath connection property to the default value, which is "admin".
For assistance in constructing the JDBC URL, use the connection string designer built into the Adobe Commerce JDBC Driver. Either double-click the JAR file or execute the jar file from the command-line.
java -jar cdata.jdbc.adobe commerce.jarπ Using the built-in connection string designer to generate a JDBC URL (adobe commerce is shown.)
After configuring the connection, follow the steps below to add the CData JDBC Driver to ColdFusion's lib directory, add a new data source, test the connection, create a ColdFusion markup file, and, finally, make a real-time connection with Adobe Commerce data and display it in a table written in the ColdFusion Markup Language, or CFML:
cdata.jdbc.adobe commerce.jar cdata.jdbc.adobe commerce.lic
Note: If you do not copy the .lic file with the jar, you will see a licensing error that indicates you do not have a valid license installed. This is true for both the trial and full versions.
jdbc:adobe commerce:OAuthClientId=MyConsumerKey;OAuthClientSecret=MyConsumerSecret;CallbackURL=http://127.0.0.1:33333;Url=https://myAdobe Commercehost.com;
The following code queries the data source:
<cfquery name="Adobe CommerceQuery" dataSource="CDataAdobe CommerceJDBC"> SELECT * FROM Products </cfquery>And a CFTable can be used to quickly output the table in HTML:
<cftable query = "Adobe CommerceQuery" border = "1" colHeaders colSpacing = "2" headerLines = "2" HTMLTable maxRows = "500" startRow = "1"> <cfcol header="<b>Name</b>" align="Left" width=2 text="Name"/> <cfcol header="<b>Price</b>" align="Left" width=15 text="Price"/> ... </cftable>Full code, including the HTML portion is available below:
<html>
<head><title>CData Software | Adobe Commerce Products Table Demo </title></head>
<body>
<cfoutput>#ucase("Adobe Commerce Products Table Demo")#</cfoutput>
<cfquery name="Adobe CommerceQuery" dataSource="CDataAdobe CommerceJDBC">
SELECT * FROM Products
</cfquery>
<cftable
query = "Adobe CommerceQuery"
border = "1"
colHeaders
colSpacing = "2"
headerLines = "2"
HTMLTable
maxRows = "500"
startRow = "1">
<cfcol header="<b>Name</b>" align="Left" width=2 text="Name"/>
<cfcol header="<b>Price</b>" align="Left" width=15 text="Price"/>
...
</cftable>
</body>
</html>
As a note, the CData JDBC Drivers also support parameterized queries using the cfqueryparam element. For example:
SELECT * FROM Account WHERE name =
Download a free, 30-day trial of the CData JDBC Driver for Adobe Commerce and start building Adobe Commerce-connected applications with Adobe ColdFusion. Reach out to our Support Team if you have any questions.
Download a free trial of the Adobe Commerce Driver to get started:
Download NowLearn more:
π Adobe Commerce IconRapidly create and deploy powerful Java applications that integrate with Adobe Commerce including Customers, Inventory, Products, Orders, and more!