Establishing a Connection
Creating a JDBC Data Source
You can create a JDBC data source to connect from your Java application. Creating a JDBC data source based on the CData JDBC Driver for ADP consists of three basic steps:
- Add the driver JAR file to the classpath. The JAR file is located in the lib subfolder of the installation directory. Note that the .lic file must be located in the same folder as the JAR file.
- Provide the driver class. For example:
cdata.jdbc.adp.ADPDriver
- Provide the JDBC URL. For example:
jdbc:adp:InitiateOAuth=GETANDREFRESH;OAuthClientId=YourClientId;OAuthClientSecret=YourClientSecret;SSLClientCert='c:\\cert.pfx';SSLClientCertPassword='admin@123' or jdbc:cdata:adp:InitiateOAuth=GETANDREFRESH;OAuthClientId=YourClientId;OAuthClientSecret=YourClientSecret;SSLClientCert='c:\\cert.pfx';SSLClientCertPassword='admin@123'
You can use the second format above whenever there is a conflict in your application between drivers using the same URL format to ensure you are using the CData driver. The URL must start with either "jdbc:adp:" or "jdbc:cdata:adp:" and can include any of the connection properties in name-value pairs separated with semicolons.
Connecting to ADP
Before configuring your connection, ensure you have obtained and formatted your SSL client certificate as described in Before You Connect.
To connect to ADP, set the following properties:
- OAuthClientId: The client Id of the custom OAuth application you obtained from ADP.
- OAuthClientSecret: The custom OAuth application's client secret.
- SSLClientCert: The full file path to your SSL client certificate. If using a .pem file, ensure it contains both the Private Key and Public Certificate. If using a .pfx file, ensure it was created with the correct export password. See Before You Connect for more information.
- SSLClientCertPassword: The password for the SSL client certificate, if applicable.
- UseUAT: The driver makes requests to the production environment by default. If using a developer account, set UseUAT = true.
- RowScanDepth: The maximum number of rows to scan for the custom fields columns available in the table (default=100). Setting a high value may decrease performance.