Skip to content

Instantly share code, notes, and snippets.

@attila123
Last active October 27, 2021 20:20
Show Gist options
  • Save attila123/d52d521a0f25fc912ec86a77c7c0a30d to your computer and use it in GitHub Desktop.
Save attila123/d52d521a0f25fc912ec86a77c7c0a30d to your computer and use it in GitHub Desktop.

Purpose

Set up a GUI client application for Cassandra

Preparation

  • Make sure you have Java 11 or newer (and set as default Java). (Otherwise you will get an error message when you try to add the driver in SQuirreL SQL.)
  • Download the driver
wget https://dbschema.com/jdbc-drivers/CassandraJdbcDriver.zip

(Go to https://dbschema.com/cassandra-jdbc-driver.html there you will find the link for the driver: "Alternative you may download the Cassandra driver using this link.")

Configuration

  • Run SQuirrelSQL
  • Select menu item Windows -> View Drivers
  • In the Drivers section click the + (plus) icon
  • Fill in the following (recommended) values:
    Name: Cassandra JDBC Driver (dbschema.com)
    Example URL: jdbc:cassandra://host1[:port1][,host2[:port2],...[,hostN[:portN]]][/[keyspace][?options]]
    Website URL: https://dbschema.com/cassandra-jdbc-driver.html
  • Click the Extra Class Path tab
  • Click the Add button
  • Select your directory where you unzipped the downloaded drivers and add all the .jar files
  • Still in this dialog, at the bottom set Class Name to com.dbschema.CassandraJdbcDriver
  • Click OK to close the dialog.

Note: the example URL is documented at the driver's website, the class name can be found from the drivers's source code (which is linked from the driver's website).

Creating a connection

  • Select menu item Windows -> View Aliases
  • In the Aliases section click the + (plus) icon
  • Enter your connection details. In the simplest case the URL may be e.g. jdbc:cassandra://host where host is the hostname of the DB server. Otherwise please refer to the Example URL above.
  • You may test your connection clicking the Test button, it should succeed.
  • Click OK to close the dialog.

Using the connection

  • Double click the connection to connet it
  • Go to the SQL tab, enter your statement e.g. select ...
  • Ctrl + Enter to run the query (or click the corresponding icon)
@kbell2020
Copy link

kbell2020 commented Oct 27, 2021

Thanks for the detailed instructions. I wasn't able to connect to DSE Cassandra using SQuirrelSQL v4.3.0 with the example URL format above, but this worked for me: jdbc:c*://host/keyspace

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment