JDBC


JDBC


This page outlines the steps to use the JDBC driver for Connect AI.

Note:Connect AI でJDBC を設定して使用する前に、データソースをConnect AI アカウントに接続する必要があります。詳細は、Sources を参照してください。

Install the Driver

Download and run the JDBC setup file for your operating system.

Create a JDBC Data Source

Follow these steps to create a JDBC data source to connect to Connect AI from your Java application:

  1. Add the driver JAR file to the classpath. The JAR file is located in the lib subfolder of the JDBC driver for Connect AI installation directory.
    Note: The .lic file must be located in the same folder as the JAR file.

  2. Some applications automatically populate the driver class. For applications that do not automatically populate it, you must enter it manually. For example:

    cdata.jdbc.connect.ConnectDriver
    
  3. Provide the JDBC URL. For example:

    jdbc:connect:AuthScheme=OAuth;
    

    or

    jdbc:cdata:connect:AuthScheme=OAuth;
    

    The second format above can be used to ensure you are using the CData driver whenever there is a conflict in your application between drivers using the same URL format. The URL must start with either jdbc:connect: or jdbc:cdata:connect:, and it must only include the AuthScheme setting as OAuth.

Connect to Connect AI

There are two ways to connect to Connect AI through the JDBC driver: OAuth authentication and Basic authentication.

To connect to Connect AI using OAuth, set the Auth Scheme in your JDBC connection as OAuth. If the OAuth login page appears in your default web browser, log in to Connect AI to proceed.

If you are unable to use browser-based OAuth authentication to connect to Connect AI, you can use Basic authentication. In this case, set the AuthScheme in your JDBC connection to Basic, and then set the User and Personal Access Token for Connect AI.

Embedded Cloud users can connect the JDBC client to Embedded Cloud using OAuthJWT authentication. Set the Auth Scheme in your JDBC connection as OAuthJWT.

Connect to a Workspace

To connect the JDBC client to a specific workspace, you specify the workspace name in the Advanced tab of the JDBC driver for Connect AI.

Designate a Log File

You can designate a log file for the JDBC driver in the Advanced tab of Connection Properties. You can also change the verbosity of the log file for greater detail.

Learn More

To learn more information about using the JDBC driver for Connect AI, click here.