Table of Contents

How to connect to Cassandra Cloud AstraDb with JDBC ?

About

This article shows you how you can connect to an AstraDb database with Jdbc. 1)

Steps

Download the Cassandra Astra Driver

Download the JDBC driver at datastax 2)

Download Jdbc Cassandra

Optional for Idea - Create a new driver

Create a new driver with the following properties:

Idea Datagrip Astradb Drivers

Auth

From the Astra DB console:

Connect String

Create a new connection with the following JDBC URL

jdbc:cassandra://keyspace;DefaultKeyspace=keyspace;AuthMech=2;UID=token;PWD=<ApplicationToken>;SecureConnectionBundlePath=<PATH TO YOUR SECURE CONNECT BUNDLE>;TunableConsistency=6

where:

Example on Idea:

Astradb Idea Jdbc Connection

For legacy driver, client id and client secret correspond to username and password. They are created when you generate your application token.