I'd like to connect to Astra via JDBC, primarily using the jdbc driver used by IntelliJ which is com.dbschema.CassandraJdbcDriver.
Is there a way to do that?
I'd like to connect to Astra via JDBC, primarily using the jdbc driver used by IntelliJ which is com.dbschema.CassandraJdbcDriver.
Is there a way to do that?
@mgent, we don't have documentation on how to connect with DbSchema yet.
But if you weren't aware, there is an embedded cqlsh on Astra which you can access from your browser. For details, see Connecting to Astra databases using CQLSH.
If you'd prefer to use an IDE, there is also an embedded DataStax Studio available from your Astra DB. For details, see Connecting to databases with DataStax Developer Studio.
In the meantime, I'm going to reach out internally to the Cloud team at DataStax to see if they have instructions they can share. I will update my answer if I have anything new to add. Cheers!
p/s: You might also refer to the instructions provided here for connecting to Astra via Thia in the interim to see if you could leverage that to work with DbSchema.
I'm not sure if it's possible but I'd be happy to help if you're willing to try. A few months ago, I managed to get the GoCQL driver (not a DataStax driver) to connect to Astra (see post #3753) with help from the DataStax Cloud team (the team behind Astra).
As I understand it, the DbSchema C* JDBC driver somehow implements the Java driver so we might be able to get it to connect to Astra with a bit of fiddling around.
First up, you will need to download the secure-connect zipped bundle for your Astra database.
Unzip your copy of secure-connect-your_astra_db.zip
which will contain the following files:
ca.crt cert cert.pfx config.json cqlshrc identity.jks key trustStore.jks
The config.json
file contains the following:
host
- the contact point for the driverport
- the CQL client portkeyspace
- Cassandra keyspacetrustStoreLocation
- trustStore.jks
is the truststoretrustStorePassword
- your truststore passwordkeyStoreLocation
- identity.jks
is the keystorekeyStorePassword
- your keystore passwordSet the SSL parameters in the DbSchema.vmoptions
as follows:
-Djavax.net.ssl.trustStore=/path/to/trustStore.jks -Djavax.net.ssl.trustStorePassword=<trustStorePassword> -Djavax.net.ssl.keyStore=/path/to/identity.jks -Djavax.net.ssl.keyStorePassword=<keyStorePassword>
Using the bits of information above, the JDBC URL format is:
jdbc:cassandra://host:port/keyspace
Using my config.json
as an example:
{ "host": "c39aeb05-b52a-49b2-96c2-41f3901969e8-us-east1.db.astra.datastax.com", "port": 31234, "keyspace": "community", ... }
My JDBC URL would look like:
jdbc:cassandra://c39aeb05-b52a-49b2-96c2-41f3901969e8-us-east1.db.astra.datastax.com:31234/community
Please try it out and I'd be very interested to know how it goes. Cheers!
P.S. Oh and of course you'll need to provide the username and password. :)
@mgent just checking to see if you've had a chance to test this. Let me know either way. Cheers!
Hi, Erick! Got some direction from DataStax partner team about which JDBC Driver we should use at Liquibase: https://downloads.datastax.com/#odbc-jdbc-drivers. We have Liquibase working great with that driver. Here's how to do it: https://docs.liquibase.com/workflows/database-setup-tutorials/cassandra.html.
Now, we're working getting Liquibase working with Astra. I've set "javax.net.ssl.*" options and update my Liquibase properties to use the correct URL, username, password, keystore. (You're post above was great for that! Thanks!!!)
However, we're having some issues still.
Would you mind testing with the "Simba JDBC Driver for Apache Cassandra" (4.2) and see if that works for you like the other JDBC driver did?
Thanks!
Robert
There is a dedicated documentation here:
https://docs.datastax.com/en/astra/docs/db-integration-datagrip.html
8 People are following this question.
Java driver has high CPU usage when making parallel calls
How does Astra DB ensure high availability for the compute services?
Is it possible to produce a Kafka message that includes the before and after CDC values?
How can I send timestamp or date type with Pulsar schema and consume it in Astra sink?
DataStax Enterprise is powered by the best distribution of Apache Cassandra ™
© 2023 DataStax, Titan, and TitanDB are registered trademarks of DataStax, Inc. and its subsidiaries in the United States and/or other countries.
Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries.
Privacy Policy Terms of Use