![]() |
VOOZH | about |
The CData JDBC driver for Anaplan 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 Anaplan in PowerBuilder.
This article shows how to create a basic PowerBuilder application that uses the CData JDBC Driver for Anaplan to retrieve data.
Follow the steps below to use the Database Painter tool to create a database profile based on an JDBC URL for Anaplan. 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.
The driver supports authenticating with Basic, Certificate, or OAuth. In every case, set Region to the region where your Anaplan account data is hosted (e.g., , which is the default).
Set AuthScheme to , then supply your Anaplan User and Password. If your workspace uses single sign-on (SSO), you must be assigned as an Exception User to use Basic authentication.
Set AuthScheme to , then supply the Certificate, CertificateType, and PrivateKey properties (and the matching CertificatePassword / PrivateKeyPassword if either is encrypted). The certificate must be a CA-issued X.509 certificate registered with your Anaplan tenant administrator.
Register a custom OAuth application in Anaplan, then set the following properties:
See the Getting Started chapter of the help documentation for a guide to creating a custom OAuth app and using OAuth.
For assistance in constructing the JDBC URL, use the connection string designer built into the Anaplan JDBC Driver. Either double-click the JAR file or execute the jar file from the command-line.
java -jar cdata.jdbc.anaplan.jar
Fill in the connection properties and copy the connection string to the clipboard. A typical JDBC URL is below:
jdbc:anaplan:OAuthClientId=your_client_id;OAuthClientSecret=your_client_secret;CallbackURL=your_callback_url;Region=US1;InitiateOAuth=GETANDREFRESH;
You can use standard PowerBuilder objects to connect to JDBC data sources and execute queries. The following example shows how to retrieve Anaplan 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.anaplan.AnaplanDriver',URL='jdbc:anaplan:OAuthClientId=your_client_id;OAuthClientSecret=your_client_secret;CallbackURL=your_callback_url;Region=US1;InitiateOAuth=GETANDREFRESH;"; CONNECT USING SQLCA; dw_sales.SetTransObject(SQLCA); dw_sales.Retrieve();
Download a free trial of the Anaplan Driver to get started:
Download NowLearn more:
👁 Anaplan IconRapidly create and deploy powerful Java applications that integrate with Anaplan.