Developer Guide for ScalarDB Cluster with the Java API
ScalarDB Cluster provides a Java API for developing applications. This document explains how to use the Java API.
Add ScalarDB Cluster Client to your build
The client libraries are available in the packages for ScalarDB Cluster. Since the packages are available under a commercial license, you need to get a commercial license and permission to access the packages. For more details, please contact us.
Before you add the dependency, you need to add the Maven repository by using your build tool, such as Gradle and Maven.
To add the Maven repository by using Gradle, add the following repository to your build.gradle
file:
repositories {
...
maven {
url = uri("https://maven.pkg.github.com/scalar-labs/scalardb-cluster")
credentials {
username = project.findProperty("gpr.user") ?: System.getenv("USERNAME")
password = project.findProperty("gpr.key") ?: System.getenv("TOKEN")
}
}
}
If you use ScalarDB Cluster SQL, you will need to add the following dependency to your build.gradle
file as well:
repositories {
...
maven {
url = uri("https://maven.pkg.github.com/scalar-labs/scalardb-sql")
credentials {
username = project.findProperty("gpr.user") ?: System.getenv("USERNAME")
password = project.findProperty("gpr.key") ?: System.getenv("TOKEN")
}
}
}
In this case, you need to set the gpr.user
property to your GitHub username and the gpr.key
property to your personal access token.
To do so, you must either set the properties in ~/.gradle/gradle.properties
or specify the properties with the -P
option when running the ./gradlew
command as follows:
./gradlew build -Pgpr.user=<YOUR_GITHUB_USERNAME> -Pgpr.key=<YOUR_PERSONAL_ACCESS_TOKEN>
Or you can use environment variables, such as USERNAME
for your GitHub username and TOKEN
for your personal access token.
export USERNAME=<YOUR_GITHUB_USERNAME>
export TOKEN=<YOUR_PERSONAL_ACCESS_TOKEN>