Using Datagrip With Astra
🏠 Back to home | Last Update 2/17/2022
- This page is a copy of the AstraDB doc page
- You can found another version on the Sebastian Estevez Blog
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.
- Create an Astra Database
- Create an Astra Token
- Download your secure connect bundle ZIP
- Download and install DataGrip
Download the JDBC driver from the DataStax website:
- Go to https://downloads.datastax.com/#odbc-jdbc-drivers.
- Select Simba JDBC Driver for Apache Cassandra.
- Select JDBC 4.2.
- Read the license terms and accept it (click the checkbox).
- Hit the blue Download button.
- Once the download completes, unzip the downloaded file.
- Download the settings.zip locally
⚠️ If you are already a DataGrip user, back up your existing settings because the download settings.zip might override your existing settings.
-
Selecting
File
→Manage IDE Settings
→Import 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 Advanced Settings to confirm the VM home path is set to Default. VM home path is set to a value named Default.
When you create your connection, the URL will look like this: jdbc:cassandra://;AuthMech=<2>;UID=token;PWD=<ApplicationToken>;SecureConnectionBundlePath=<PATH TO YOUR SECURE CONNECT BUNDLE>;TunableConsistency=<6>
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.