Search code examples
dbeaverscyllacassandra-driver

ScyllaDB cqlsh JDBC Driver with DBeaver


I am trying to connect through ScyllaDB using a third party JDBC driver. I am largely referencing here: https://java-driver.docs.scylladb.com/stable/index.html#

  1. Going to maven.com here: https://search.maven.org/search?q=g:com.scylladb and grabbing the java-driver-core-shaded
  2. Open up DBeaver
    1. Database > Driver Manager > New > Library > Add file
    2. Pick the downloaded shaded .jar file
    3. Go back to Settings tab
    4. Populate accordingly
    5. Hit ok
  3. Then go back to Database > New connection
    1. Put the JDBC info in accordingly jdbc:cassandra://hostname:9042

However, I am getting the following error:

Can't create driver instance
  Error during driver instantiation
  Error during driver instantiation
    com.datastax.oss.driver.api.core.CqlSession.<init>()
    com.datastax.oss.driver.api.core.CqlSession.<init>()

Furthermore, if I try to use com.ing.data.cassandra.jdbc.CassandraDriver this driver, I am able to inspect my schemas, but anytime I query a table, I get:

SQL Error: com.datastax.oss.driver.api.core.NoNodeAvailableException: No node was available to execute the query

Has anyone actually done this successfully?


Solution

  • The Java driver is a client that exclusive uses the Cassandra native CQL binary protocol. It is completely different from JDBC-compliant drivers so you won't be able to use it with DBeaver.

    The cassandra-jdbc-wrapper from ING is a wrapper for the Cassandra Java driver that is JDBC-compliant that works with Apache Cassandra 2.1+, DataStax Enterprise 5.0+ and DataStax Astra DB (see the compatibility matrix).

    In theory it should work however it is not officially tested on ScyllaDB so you'll have to do some testing of your own.

    The NoNodeAvailableException indicates that the driver is not able to reach your cluster at all so you need to make sure that there's network connectivity between your laptop/machine where DBeaver is installed and your ScyllaDB instance.

    One important thing to add is that you must specify BOTH (1) the keyspace name, and (2) the local DC. The JDBC URL should look something like this:

    jdbc:cassandra://myhost:9042/ks_name?localdatacenter=DC1
    

    For more info, see the JDBC driver and connection string page. Cheers!