Connect to Webflow Data from PowerBuilder via JDBC

Jerod Johnson
Jerod Johnson
Director, Technology Evangelism
This article demonstrates how to access Webflow data from PowerBuilder using the Webflow JDBC Driver.

The CData JDBC driver for Webflow 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 Webflow in PowerBuilder.

This article shows how to create a basic PowerBuilder application that uses the CData JDBC Driver for Webflow to retrieve data.

Connect to Webflow Data from PowerBuilder

Follow the steps below to use the Database Painter tool to create a database profile based on an JDBC URL for Webflow. 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.

  1. 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.

  2. Click Tools -> Database Painter.
  3. Right-click the JDBC node and click New Profile.
  4. 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.api.APIDriver
    • URL: Enter the JDBC URL.

      Authentication

      Webflow uses OAuth 2.0 authentication to ensure secure access to sites, CMS collections, e-commerce data, and other resources. This authentication method allows you to securely connect to your Webflow workspace and manage resources with proper authorization.

      OAuth 2.0 Setup and Configuration

      Step 1: Create a Webflow OAuth Application

      To set up OAuth authentication:

      1. Visit the Webflow Developer Portal
      2. Navigate to "Apps & Integrations" in your Webflow account
      3. Click "Register an App" to create a new OAuth application
      4. Configure the application name, description, and redirect URI (CallbackURL)
      5. Copy the Client ID and Client Secret for use in your connection

      Required Connection Properties

      • AuthScheme: Set this to OAuth (required)
      • OAuthClientId: Client ID from your Webflow OAuth application (required)
      • OAuthClientSecret: Client secret from your Webflow OAuth application (required)
      • CallbackURL: Redirect URI specified in your OAuth application (required)
      • InitiateOAuth: Set to GETANDREFRESH for automatic token management (recommended)

      Required OAuth Scopes

      The Webflow API Profile requires the following OAuth scopes:

      • sites:read - Read access to site information and configuration
      • pages:read - Read access to site pages
      • cms:read - Read access to CMS collections and items
      • forms:read - Read access to forms and form submissions
      • assets:read - Read access to media assets and folders
      • ecommerce:read - Read access to products, orders, and inventory
      • authorized_user:read - Read access to the authorized user

      Built-in Connection String Designer

      For assistance in constructing the JDBC URL, use the connection string designer built into the Webflow JDBC Driver. Either double-click the JAR file or execute the jar file from the command-line.

      java -jar cdata.jdbc.api.jar
      

      Fill in the connection properties and copy the connection string to the clipboard. A typical JDBC URL is below:

      jdbc:api:Profile=C:\profiles\Webflow.apip;AuthScheme=OAuth;InitiateOAuth=GETANDREFRESH;OAuthClientId=your_client_id;OAuthClientSecret=your_client_secret;CallbackUrl=your_callback_url;
  5. To view and modify a table, right-click a table and then click Edit Data -> Grid.

Using Webflow 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 Webflow 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.api.APIDriver',URL='jdbc:api:Profile=C:\profiles\Webflow.apip;AuthScheme=OAuth;InitiateOAuth=GETANDREFRESH;OAuthClientId=your_client_id;OAuthClientSecret=your_client_secret;CallbackUrl=your_callback_url;";
CONNECT USING SQLCA;
dw_sites.SetTransObject(SQLCA);
dw_sites.Retrieve();

Ready to get started?

Connect to live data from Webflow with the API Driver

Connect to Webflow