Ready to get started?

Download a free trial of the Google Cloud Storage Driver to get started:

 Download Now

Learn more:

Google Cloud Storage Icon Google Cloud Storage JDBC Driver

Rapidly create and deploy powerful Java applications that integrate with Google Cloud Storage.

Connect to Google Cloud Storage Data in IntelliJ



Integrate connectivity to Google Cloud Storage data with wizards in IntelliJ.

The CData JDBC Driver for Google Cloud Storage enables you to access Google Cloud Storage as a JDBC data source, providing integration with rapid development tools in IDEs. This article shows how to use the data source configuration wizard to connect to Google Cloud Storage data in IntelliJ.

Create a JBDC Data Source for Google Cloud Storage

Follow the steps below to add the driver JAR and define connection properties required to connect to Google Cloud Storage data.

  1. In the Data Sources window, right-click and then click Add Data Source -> DB Data Source.
  2. In the Data Source Properties dialog that appears, the following properties are required:

    • JDBC Driver Files: Click the button next to this menu to add the JDBC Driver file cdata.jdbc.googlecloudstorage.jar, located in the installation directory.
    • JDBC Driver Class: In this menu, select cdata.jdbc.googlecloudstorage.GoogleCloudStorageDriver from the list.
    • Database URL: Enter the connection URL in the JDBC URL property. The URL must start with jdbc:googlecloudstorage: and includes connection properties separated with semicolons.

      Authenticate with a User Account

      You can connect without setting any connection properties for your user credentials. After setting InitiateOAuth to GETANDREFRESH, you are ready to connect.

      When you connect, the Google Cloud Storage OAuth endpoint opens in your default browser. Log in and grant permissions, then the OAuth process completes

      Authenticate with a Service Account

      Service accounts have silent authentication, without user authentication in the browser. You can also use a service account to delegate enterprise-wide access scopes.

      You need to create an OAuth application in this flow. See the Help documentation for more information. After setting the following connection properties, you are ready to connect:

      • InitiateOAuth: Set this to GETANDREFRESH.
      • OAuthJWTCertType: Set this to "PFXFILE".
      • OAuthJWTCert: Set this to the path to the .p12 file you generated.
      • OAuthJWTCertPassword: Set this to the password of the .p12 file.
      • OAuthJWTCertSubject: Set this to "*" to pick the first certificate in the certificate store.
      • OAuthJWTIssuer: In the service accounts section, click Manage Service Accounts and set this field to the email address displayed in the service account Id field.
      • OAuthJWTSubject: Set this to your enterprise Id if your subject type is set to "enterprise" or your app user Id if your subject type is set to "user".
      • ProjectId: Set this to the Id of the project you want to connect to.

      The OAuth flow for a service account then completes.

      Built-in Connection String Designer

      For assistance in constructing the JDBC URL, use the connection string designer built into the Google Cloud Storage JDBC Driver. Either double-click the JAR file or execute the jar file from the command-line.

      java -jar cdata.jdbc.googlecloudstorage.jar

      Fill in the connection properties and copy the connection string to the clipboard.

      A typical JDBC URL is the following:

      jdbc:googlecloudstorage:ProjectId='project1';InitiateOAuth=GETANDREFRESH

Edit and Save Google Cloud Storage Data

To discover schema information, right-click the data source you just created and click Refresh Tables. To query a table, right-click it and then click Open Tables Editor.