JDBC Driver for IBM Cloud Object Storage

Build 25.0.9434

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 IBM Cloud Object Storage consists of three basic steps:

  1. 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.
  2. Provide the driver class. For example:
    cdata.jdbc.ibmcloudobjectstorage.IBMCloudObjectStorageDriver
  3. Provide the JDBC URL. For example:
    jdbc:ibmcloudobjectstorage:ApiKey=myApiKey;CloudObjectStorageCRN=MyInstanceCRN;Region=myRegion;OAuthClientId=MyOAuthClientId;OAuthClientSecret=myOAuthClientSecret;
    
    or
    
    jdbc:cdata:ibmcloudobjectstorage:ApiKey=myApiKey;CloudObjectStorageCRN=MyInstanceCRN;Region=myRegion;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:ibmcloudobjectstorage:" or "jdbc:cdata:ibmcloudobjectstorage:" and can include any of the connection properties in name-value pairs separated with semicolons.

Connecting to IBM Cloud Object Storage

To connect to IBM Cloud Object Storage data, set these parameters:

  • InitiateOAuth: GETANDREFRESH. You can use InitiateOAuth to avoid repeating the OAuth exchange and manually setting the OAuthAccessToken.
  • ApiKey: The API key which was noted during setup (see Before You Connect).
  • CloudObjectStorageCRN (Optional): The cloud object storage CRN established during setup (see Before You Connect). The driver attempts to retrieve this automatically, but if you have more than one Cloud Object Storage account, we recommend that you specify this explicitly.

When you connect, the driver completes the OAuth process.

  1. Extracts the access token and authenticates requests.
  2. Saves OAuth values in OAuthSettingsLocation to be persisted across connections.

Copyright (c) 2025 CData Software, Inc. - All rights reserved.
Build 25.0.9434