Installation

Learn how to install and get started with the CrateDB legacy JDBC driver.

Table of contents

Prerequisites

The CrateDB JDBC driver requires Java 8, preferably update 20 or later. We recommend using Oracle’s Java on macOS and OpenJDK on Linux Systems. Please also consult the Compatibility notes for additional information.

Install

The driver comes in two variants, available on Maven Central at the repository root folder.

  • crate-jdbc

    The driver JAR, suitable to be used as a dependency in your project.

  • crate-jdbc-standalone

    A single, standalone JAR file, that bundles all the driver dependencies, suitable to be used as a plugin for tools such as SQuirreL. This variant should not be used as a dependency in a Maven or Gradle project.

See also

To build the CrateDB JDBC driver from the source code, follow the developer guide.

Set up as a dependency

This section shows you how to set up the CrateDB JDBC driver as a dependency using Maven or Gradle, two popular build tools for Java projects.

Maven

Add crate-jdbc as a dependency, like so:

<dependencies>
    <dependency>
        <groupId>io.crate</groupId>
        <artifactId>crate-jdbc</artifactId>
        <version>2.7.0</version>
    </dependency>
</dependencies>

Gradle

If you’re using Gradle, you will need to add the Maven Central repository to your build.gradle file:

repositories {
    mavenCentral()
}

Then, add crate-jdbc as a dependency:

dependencies {
    implementation 'io.crate:crate-jdbc:2.7.0'
}

Next steps

Once the JDBC driver is set up, you probably want to connect to CrateDB.