Java Driver installation

Prerequisites

To use the Java Driver, we need a compatible version of TypeDB server running. Please see the Compatibility Table to check what version do we need, depending on the TypeDB server version being used.

Add a repository with TypeDB Java Driver to Maven

Add the code below to the pom.xml file in the Maven project.

Be sure to replace the {version} placeholder tag with the version of Client Java we want to install.

<repositories>
    <repository>
        <id>repo.vaticle.com</id>
        <url>https://repo.vaticle.com/repository/maven/</url>
    </repository>
</repositories>
<dependencies>
<dependency>
    <groupId>com.vaticle.typedb</groupId>
    <artifactId>typedb-client</artifactId>
    <version>{version}</version>
</dependency>
</dependencies>

If we want to depend on snapshot versions of Client Java, by referring to the GitHub commit sha, we can add our snapshot repository to our list of Maven repositories.

<repositories>
    <repository>
        <id>repo.vaticle.com.snapshot</id>
        <name>repo.vaticle.comai</name>
        <url>https://repo.vaticle.com/repository/maven-snapshot/</url>
    </repository>
</repositories>

(Optional) Add logging config

By default, the Java Driver uses Logback to print errors and debugging info to standard output. As it is quite verbose, use the following steps to set the minimum log level to ERROR:

  1. Create a file in the resources path (src/main/resources by default in a Maven project) named logback.xml.

  2. Copy the following document into the logback.xml:

<configuration>
    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
        <encoder>
            <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
        </encoder>
    </appender>

    <root level="ERROR">
        <appender-ref ref="STDOUT"/>
    </root>

</configuration>

Version Compatibility

Java Driver Protocol version TypeDB TypeDB Enterprise & TypeDB Cloud

2.18.0, 2.18.1

1

2.18.0 to 2.22.0

2.18.0 to 2.21.1

2.17.0 to 2.17.1

N/A

2.17.0

2.17.0

2.16.1

N/A

2.16.1

2.16.1

2.14.1 to 2.14.3

N/A

2.14.1 to 2.15

2.14.1 to 2.15.0

2.12.0

N/A

2.12.0 to 2.13.0

2.13.0

2.9.0 to 2.11.1

N/A

2.9.0 to 2.11.1

2.9.0 to 2.11.2

2.8.0

N/A

2.8.0

N/A

2.6.0 to 2.6.2

N/A

2.6.0 to 2.7.1

N/A

2.5.0

N/A

2.1.2 to 2.5.0

2.5.0

2.1.0 to 2.4.0

N/A

2.1.2 to 2.5.0

2.1.2 to 2.3.0

2.0.1

N/A

2.0.2

2.0.2

2.0.0

N/A

2.0.0, 2.0.1

2.0.0, 2.0.1

1.8.3

N/A

1.8.0 to 1.8.4

N/A

1.8.2

N/A

1.8.0, 1.8.1

N/A

1.8.0 to 1.8.1

N/A

1.8.0

N/A