Prerequisites
- Java 8 or later
- A running cluster
Download
The StarRocks JDBC driver is available on Maven Central. You can download the JAR directly from Maven Central, or add it as a dependency in your project using the instructions below.Download via Maven CLI
If you have Maven installed, you can download the JAR without creating a project:Use the JAR in your project
Maven
Add the following dependency to yourpom.xml:
Gradle
Add the following dependency to yourbuild.gradle:
Plain Java
Download the JAR from Maven Central and add it to the classpath when compiling and running:Connection URL format
Example:
Connection properties
Metadata discovery
The StarRocks JDBC driver supports standard JDBC metadata APIs (DatabaseMetaData), which allow tools to introspect catalogs, schemas, tables, and columns. This enables IDE features such as schema browsing, auto-complete, and table introspection to work out of the box.