We are proud to share our inclusion in the 2024 Gartner Magic Quadrant for Data Integration Tools. We believe this recognition reflects the differentiated business outcomes CData delivers to our customers.
Get the Report →Connect to WooCommerce Data from PowerBuilder
This article demonstrates how to access WooCommerce data from PowerBuilder using the WooCommerce JDBC Driver.
The CData JDBC driver for WooCommerce is a standards-based control that can be used from any platform or development technology that supports JDBC, including PowerBuilder. This article shows how to use the CData JDBC Driver for WooCommerce in PowerBuilder.
This article shows how to create a basic PowerBuilder application that uses the CData JDBC Driver for WooCommerce to perform reads and writes.
Connect to WooCommerce Data from PowerBuilder
Follow the steps below to use the Database Painter tool to create a database profile based on an JDBC URL for WooCommerce. You can use a database profile to save connection properties. In the Database Painter, you can graphically manipulate data as well as execute SQL queries.
Add the driver JAR to the PowerBuilder classpath. Set the CLASSPATH system environment variable to the path to the driver JAR, located in the lib subfolder of the installation directory.
Note: If you are using PowerBuilder Classic, you can also add the path to the driver JAR by clicking Tools -> System Options -> Java.
- Click Tools -> Database Painter.
- Right-click the JDBC node and click New Profile.
- In the Database Profile Setup dialog, enter the following:
- Profile Name: Enter a user-friendly name for the profile.
- Driver Name: Enter the class name of the driver, cdata.jdbc.woocommerce.WooCommerceDriver
- URL: Enter the JDBC URL.
WooCommerce supports the following authentication methods: one-legged OAuth1.0 Authentication and standard OAuth2.0 Authentication.
Connecting using one-legged OAuth 1.0 Authentication
Specify the following properties (NOTE: the below credentials are generated from WooCommerce settings page and should not be confused with the credentials generated by using WordPress OAuth2.0 plugin):
- ConsumerKey
- ConsumerSecret
Connecting using WordPress OAuth 2.0 Authentication
- To view and modify a table, right-click a table and then click Edit Data -> Grid.

Using WooCommerce Data with PowerBuilder Controls
You can use standard PowerBuilder objects to connect to JDBC data sources and execute queries. The following example shows how to retrieve WooCommerce data into a DataWindow. You can add the following code to the open method:
SQLCA.DBMS = "JDBC"
SQLCA.AutoCommit = False
SQLCA.DBParm = "Driver='cdata.jdbc.woocommerce.WooCommerceDriver',URL='jdbc:woocommerce:Url=https://example.com/; ConsumerKey=ck_ec52c76185c088ecaa3145287c8acba55a6f59ad; ConsumerSecret=cs_9fde14bf57126156701a7563fc87575713c355e5; InitiateOAuth=GETANDREFRESH";
CONNECT USING SQLCA;
dw_orders.SetTransObject(SQLCA);
dw_orders.Retrieve();