Skip to content

‣ Datagrip

Overview

DataGrip is a database management environment for developers. It is designed to query, create, and manage databases. Databases can work locally, on a server, or in the cloud. Supports MySQL, PostgreSQL, Microsoft SQL Server, Oracle, and more. If you have a JDBC driver, add it to DataGrip, connect to your DBMS, and start working.

Prerequisites

Astra Community JDBC Drivers

1. Download JDBC Driver

Download latest archive astra-jdbc-driver-x.y.jar from Github Release page

2. Configure the Connection

  1. Select Drivers Tab
  2. Click the plus + symbol to create a new User Driver
  3. Populate the name as you like, in the screenshot we picked Astra JDBC Driver
  4. Add the shaded jar by clicking the plus + symbol in the Driver Files panel.
  5. For the Class field, select the following (the list has been build by scanner the library we just imported)
com.datastax.astra.jdbc.AstraJdbcDriver

3. Create the DataSource

  • 1. Select Data Source tabs.Using the + add a new Data source pick the driver we just created from the list
  • 2. Define a name for your datasource on the screenshot we picked Astra JDBC DataSource
  • 3. Validate that you are using the driver define above, for us Astra JDBC Driver
  • 4. Provide User Name. It can be the string token or the value of a clientId.
  • 5. Provide the password. It can be the value for your starting with AstraCS:... or the value of a clientSecret.
  • 6. Provide the URL as a single line
jdbc:astra://<db>/<keyspace>?region=<region>
Field Required? Description
db YES It is your database identifier it can be a name (then it must be unique) or a database identifier (UUID)
keyspace YES It is the keyspace you want to use.
region NO Only useful if the database lives on multiple regions

  • 7. Test the connection you should get the following screen, apply and save.

  • 8. Validate with Apply

4. Use DataSource

  1. Select the keyspace you want to use

  1. Enjoy your working environment

Using JDBC Simba Drivers

Tips for SecureConnectionBundlePath

You need to be a registered customer to use those drivers. If not consider the ING Driver alternative.

1. Download JDBC Driver

Download the JDBC driver from the Datastax customer support website

  1. Authenticate to Datastax Customer Portal.
  2. Select Simba JDBC Driver for Apache Cassandra.
  3. Select JDBC 4.2.
  4. Read the license terms and accept it (click the checkbox).
  5. Hit the blue Download button.
  6. Once the download completes, unzip the downloaded file.

2. Download Settings.zip

Think about backing up your settings.xml

If you are already a DataGrip user, back up your existing settings because downloading settings.zip might override your existing settings.

3. Import settings.zip file

  • Selecting FileManage IDE SettingsImport Settings in DataGrip.

  • From the directory menu, select the settings.zip file from the directory where it is stored.

  • Select Import and Restart.

You will see a new database connection type called Astra: Simba Cassandra JDBC 4.2 driver shown.

  • Go to the Driver Advanced Settings TAB to confirm the VM home path is set to Default.

4. Establish the connection

  • The credentials are provided in the URL so for authentication field you can pick No auth in the select drop down.

  • When you create your connection, the URL will look like this (on a single line):

jdbc:cassandra://;AuthMech=2;
UID=token;
PWD=<AstraCS:... your application token>;
SecureConnectionBundlePath=<PATH TO YOUR SECURE CONNECT BUNDLE>;
TunableConsistency=6

Tips for SecureConnectionBundlePath

  • You should use / as a path separator even on Windows.

  • The use of quotes for the path is not supported, please try to provide a path with no spaces.

URL in the screenshot shows the format described in the previous sentence.

  • AuthMech: Specifies whether the driver connects to a Cassandra or Astra DB database and whether the driver authenticates the connection.
  • ApplicationToken: Generated from Astra DB console.
  • SecureConnectionBundlePath: Path to where your downloaded Secure Connect Bundle is located.
  • TunableConsistency: Specifies Cassandra replica or the number of Cassandra replicas that must process a query for the query to be considered successful.

Last update: 2023-10-13