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 Marketo 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.marketo.MarketoDriver
- Provide the JDBC URL. For example:
jdbc:marketo:URL=https://MyMarketoURL.mktorest.com/;OAuthClientId=MyOAuthClientId;OAuthClientSecret=MyOAuthClientSecret; or jdbc:cdata:marketo:URL=https://MyMarketoURL.mktorest.com/;OAuthClientId=MyOAuthClientId;OAuthClientSecret=MyOAuthClientSecret;
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:marketo:" or "jdbc:cdata:marketo:" and can include any of the connection properties in name-value pairs separated with semicolons.
Connecting to Marketo
The following connection options are required when connecting to Marketo.- URL: The URL of the REST API Service. You can locate this in Admin -> Integration -> Web Services -> REST API. Example values: https://123-abc-456.mktorest.com/ or https://123-abc-456.mktorest.com/rest.
- OAuthClientId: The OAuth Client ID associated with your custom service.
- OAuthClientSecret: The OAuth Client Secret associated with your custom service.
Obtaining OAuth Credentials
Before obtaining OAuth credentials you need to create a custom service if you do not already have one. To do so follow the instructions provided in Creating a Custom Service.
To obtain OAuth credentials for a custom service:
- Go to the Admin tab.
- Click on the LaunchPoint option.
- Select the service and click on View Details.
- Marketo displays a window that shows the authentication credentials. Use "Client Id" as the value for OAuthClientId and "Client Secret" for OAuthClientSecret.