Ready to get started?

Download a free trial of the CockroachDB Driver to get started:

 Download Now

Learn more:

CockroachDB Icon CockroachDB JDBC Driver

Rapidly create and deploy powerful Java applications that integrate with CockroachDB.

Connect to CockroachDB Data in Aqua Data Studio



Access CockroachDB data from tools in Aqua Data Studio such as the Visual Query Builder and the Table Data Editor.

The CData JDBC Driver for CockroachDB integrates CockroachDB data with wizards and analytics in IDEs like Aqua Data Studio. This article shows how to connect to CockroachDB data through the connection manager and execute queries.

Create a JDBC Data Source

You can use the connection manager to define connection properties and save them in a new JDBC data source. The CockroachDB data source can then be accessed from Aqua Data Studio tools.

  1. In Aqua Data Studio, select Register Server from the Servers menu.
  2. In the Register Server form, select the 'Generic - JDBC' connection.
  3. Enter the following JDBC connection properties:
    • Name: Enter a name for the data source; for example, CockroachDB.
    • Driver Location: Click the Browse button and select the cdata.jdbc.cockroachdb.jar file, located in the lib subfolder of the installation directory.
    • Driver: Enter the Driver's class name, cdata.jdbc.cockroachdb.CockroachDBDriver.
    • URL: Enter the JDBC URL, which starts with jdbc:cockroachdb: and is followed by a semicolon-separated list of connection properties.

      Set the following to connect to CockroachDB.

      • Server: The host name or IP address of the server.
      • Port: The port number of the CockroachDB server. If not specified, the default port is 26257.
      • Database: The name of the Cockroach database. If not specified, you connect to the user's default database.
      • User: The Cockroach DB user account used to authenticate.
      • Password: The password used to authenticate the user.

      Built-in Connection String Designer

      For assistance in constructing the JDBC URL, use the connection string designer built into the CockroachDB JDBC Driver. Either double-click the JAR file or execute the jar file from the command-line.

      java -jar cdata.jdbc.cockroachdb.jar

      Fill in the connection properties and copy the connection string to the clipboard.

      A typical JDBC URL is below:

      jdbc:cockroachdb:User=root;Password=root;Database=system;Server=localhost;Port=26257

Query CockroachDB Data

You can now query the tables exposed.