Supported projects

The following projects can be used to implement Java applications using the YugabyteDB YSQL and YCQL APIs.

Driver Documentation and Guides Latest Driver Version Supported YugabyteDB Version
YugabyteDB JDBC Driver [Recommended] Documentation
Reference
Blog
42.7.3-yb-1
(Supports Java 21)
2.8 and above
YugabyteDB R2DBC Driver Documentation 1.1.0-yb-1-ea 2.18 and above
PostgreSQL JDBC Driver Documentation
Reference
42.3.4 2.4 and above
Vert.x Pg Client Documentation 4.3.2
YugabyteDB YCQL (3.10) Driver Documentation 3.10.3-yb-2
YugabyteDB YCQL (4.15) Driver Documentation 4.15.0-yb-1

Learn how to establish a connection to a YugabyteDB database and begin basic CRUD operations by referring to Connect an app or Use an ORM.

Prerequisites

To develop Java driver applications for YugabyteDB, you need the following:

  • Java Development Kit (JDK)

    Install JDK 8 or later. JDK installers for Linux and macOS can be downloaded from Oracle, Adoptium (OpenJDK), or Azul Systems (OpenJDK). Homebrew users on macOS can install using brew install openjdk.

  • Create a Java project

    You can create Java projects using Maven or Gradle software project management tools. For ease-of-use, use an integrated development environment (IDE) such as IntelliJ IDEA or Eclipse IDE to configure Maven or Gradle to build and run your project.

    If you are not using an IDE, see Building Maven or Creating New Gradle Projects for more information on how to set up a Java project.

    1. Create a project called "DriverDemo".

      $ mvn archetype:generate \
           -DgroupId=com.yugabyte \
           -DartifactId=DriverDemo \
           -DarchetypeArtifactId=maven-archetype-quickstart \
           -DinteractiveMode=false
      
      $ cd DriverDemo
      
    2. Open the pom.xml file in a text editor and add the following below the <url> element.

      <properties>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
      </properties>
      

      If you're using Java 11, it should be:

       <properties>
         <maven.compiler.source>11</maven.compiler.source>
         <maven.compiler.target>11</maven.compiler.target>
       </properties>
      
  • YugabyteDB cluster

    • Create a free cluster on YugabyteDB Aeon. Refer to Use a cloud cluster. Note that YugabyteDB Aeon requires SSL.
    • Alternatively, set up a standalone YugabyteDB cluster by following the steps in Install YugabyteDB.

Next step

Connect an app