Getting started

Learn how to install and get started with the CrateDB 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.

Consult the compatibility notes for additional information.

Install

Note

These instructions show you how to do a conventional install.

To build the CrateDB JDBC driver from the source code, follow the instructions on GitHub.

There are two ways to install the driver.

The regular CrateDB JDBC driver JAR files are hosted on Bintray and are available via JCenter.

Alternatively, you can download a single, standalone JAR file that bundles the driver dependencies. Use the Bintray file navigator to locate the version you want and download manually.

Caution

The standalone JAR file should not be used in a Maven project. It does, however, function nicely as a plugin for tools such as SQuirreL.

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.

See also

Select the blue SET ME UP! button located in the top right-hand corner of the Bintray overview page for supplementary instructions.

Maven

If you’re using Maven, you first need to add the Bintray repository to your pom.xml file:

...
<repositories>
    ...
    <repository>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
        <id>central</id>
        <name>bintray</name>
        <url>http://dl.bintray.com/crate/crate</url>
    </repository>
</repositories>
...

Then add crate-jdb ass a dependency, like so:

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

Gradle

If you’re using Gradle, you first need to add the JCenter repository to your build.gradle file:

repositories {
    ...
    jcenter()
}

Then add crate-jdb as a dependency, like so:

dependencies {
    compile 'io.crate:crate-jdbc:...'
    ...
}

Next steps

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