The Java SDK for YDB enables Java developers to work with YDB.
Before you begin, you need to create a database and setup authorization. Please see the Prerequisites section of the connection guide in documentation for information on how to do that.
To use YDB Java SDK you will need Java 1.8+.
The recommended way to use the YDB Java SDK in your project is to consume it from Maven. Firstly you can import YDB Java BOM to specify correct versions of SDK modules.
<dependencyManagement>
<dependencies>
<dependency>
<groupId>tech.ydb</groupId>
<artifactId>ydb-sdk-bom</artifactId>
<version>2.3.7</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
After that you can specify the SDK modules that your project needs in the dependencies:
<dependencies>
<!-- Scheme service client -->
<dependency>
<groupId>tech.ydb</groupId>
<artifactId>ydb-sdk-scheme</artifactId>
</dependency>
<!-- Table service client -->
<dependency>
<groupId>tech.ydb</groupId>
<artifactId>ydb-sdk-table</artifactId>
</dependency>
<!-- Query service client -->
<dependency>
<groupId>tech.ydb</groupId>
<artifactId>ydb-sdk-query</artifactId>
</dependency>
<!-- Topic service client -->
<dependency>
<groupId>tech.ydb</groupId>
<artifactId>ydb-sdk-topic</artifactId>
</dependency>
<!-- Coordination service client -->
<dependency>
<groupId>tech.ydb</groupId>
<artifactId>ydb-sdk-coordination</artifactId>
</dependency>
</dependencies>
In basic example folder there is simple example application that uses YDB Java SDK from Maven. See the Connect to a database section of the documentation for an instruction on how to setup and launch it.
In examples folder you can find more example applications with YDB Java SDK usage.
To build the YDB Java SDK artifacts locally, see Building YDB Java SDK.