JDBC Driver for Bing Ads

Build 21.0.8137

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 Bing Ads 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.bingads.BingAdsDriver
  • Provide the JDBC URL. For example:
    jdbc:bingads:InitiateOAuth=GETANDREFRESH;AccountId=442311;CustomerId=5521444;DeveloperToken=11112332233;
    
    or
    
    jdbc:cdata:bingads:InitiateOAuth=GETANDREFRESH;AccountId=442311;CustomerId=5521444;DeveloperToken=11112332233;

    The second format above can be used 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:bingads:" or "jdbc:cdata:bingads:" and can include any of the connection properties in name-value pairs separated with semicolons.

Connecting to Bing Ads

You need to register a Bing Ads account, get a developer token, and authenticate using OAuth to connect to the Bing Ads APIs.

Register a Bing Ads Account

Complete the following steps to sign up for a Bing Ads account and obtain the CustomerId and (optional) AccountId:

  1. Sign up for a Bing Ads account in the Bing Ads Web application or at the Sandbox Site for a sandbox account.
  2. Select Settings > Accounts and Billing and select a single account. The AccountId and CustomerId (cid) are displayed on the account's page and in the page's URL.

Get a Developer Token

To use the Bing Ads APIs, you must have a DeveloperToken in addition to the CustomerId. You must have the Super Admin role in Bing Ads to create a developer token, though you do not need special permissions to use the token.

  1. Log in at the Bing Ads Developer Portal as a Microsoft Account user with the Bing Ads Super Admin role.
  2. Click Request Token and take note of your developer token. You will set it in the DeveloperToken connection property.

Authenticate via OAuth Authentication

The Bing Ads APIs use the OAuth 2 standard. See Using OAuth Authentication for an authentication guide.

Copyright (c) 2022 CData Software, Inc. - All rights reserved.
Build 21.0.8137