YugaByte SQL JDBC Driver aggregate

YugaByte JDBC aggregate project

GroupId

GroupId

com.yugabyte
ArtifactId

ArtifactId

ybjdbc-aggregate
Last Version

Last Version

42.2.7-yb-2
Release Date

Release Date

Type

Type

pom
Description

Description

YugaByte SQL JDBC Driver aggregate
YugaByte JDBC aggregate project
Project URL

Project URL

https://github.com/YugaByte/ybjdbc
Source Code Management

Source Code Management

https://github.com/yugabyte/jdbc-yugabytedb

Download ybjdbc-aggregate

How to add to project

<!-- https://jarcasting.com/artifacts/com.yugabyte/ybjdbc-aggregate/ -->
<dependency>
    <groupId>com.yugabyte</groupId>
    <artifactId>ybjdbc-aggregate</artifactId>
    <version>42.2.7-yb-2</version>
    <type>pom</type>
</dependency>
// https://jarcasting.com/artifacts/com.yugabyte/ybjdbc-aggregate/
implementation 'com.yugabyte:ybjdbc-aggregate:42.2.7-yb-2'
// https://jarcasting.com/artifacts/com.yugabyte/ybjdbc-aggregate/
implementation ("com.yugabyte:ybjdbc-aggregate:42.2.7-yb-2")
'com.yugabyte:ybjdbc-aggregate:pom:42.2.7-yb-2'
<dependency org="com.yugabyte" name="ybjdbc-aggregate" rev="42.2.7-yb-2">
  <artifact name="ybjdbc-aggregate" type="pom" />
</dependency>
@Grapes(
@Grab(group='com.yugabyte', module='ybjdbc-aggregate', version='42.2.7-yb-2')
)
libraryDependencies += "com.yugabyte" % "ybjdbc-aggregate" % "42.2.7-yb-2"
[com.yugabyte/ybjdbc-aggregate "42.2.7-yb-2"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

  • ybjdbc

YugabyteDB JDBC Driver

This is a distributed JDBC driver for YugabyteDB SQL. This driver is based on the PostgreSQL JDBC Driver.

NOTE: This project is currently experimental and should not be used for production facing applications. If you are interested in more details or helping with this effort, let us know on the Yugabyte Community Slack.

Features

This JDBC driver has the following features:

Cluster Awareness to eliminate need for a load balancer

This driver adds a YBClusterAwareDataSource that requires only an initial contact point for the YugabyteDB cluster, using which it discovers the rest of the nodes. Additionally, it automatically learns about the nodes being started/added or stopped/removed. Internally a connection pool is maintained for each node. A random live node is chosen to connect to the cluster and execute a statement. it will choose a live node to get a connection. When the connection is closed by the application, it is returned to the respective pool.

Topology Awareness to enable geo-distributed apps

NOTE: This feature is still in progress.

Shard awareness for high performance

NOTE: This feature is still in the design phase.

Get the Driver

From Maven

Add the following lines to your maven project.

<dependency>
  <groupId>com.yugabyte</groupId>
  <artifactId>jdbc-yugabytedb</artifactId>
  <version>42.2.7-yb-3</version>
</dependency>

Build locally

  1. Clone this repository.

    git clone https://github.com/yugabyte/jdbc-yugabytedb.git && cd jdbc-yugabytedb
    
  2. Build and install into your local maven folder.

     mvn clean install -DskipTests
    
  3. Finally, use it by adding the lines below to your project.

    <dependency>
        <groupId>com.yugabyte</groupId>
        <artifactId>jdbc-yugabytedb</artifactId>
        <version>42.2.7-yb-3-SNAPSHOT</version>
    </dependency> 

Use the Driver

  • Create the DataSource by passing an initial contact point

    String jdbcUrl = "jdbc:postgresql://127.0.0.1:5433/yugabyte";
    YBClusterAwareDataSource ds = new YBClusterAwareDataSource(jdbcUrl);
    
  • Use like a regular (pooling) DataSource

    // Using try-with-resources to auto-close the connection when done.
    try (Connection connection = ds.getConnection()) {
        // Use the connection as usual.
    } catch (java.sql.SQLException e) {
        // Handle/Report error.
    }
    
com.yugabyte

yugabyte

The high-performance distributed SQL database for global, internet-scale apps.

Versions

Version
42.2.7-yb-2
42.2.7-yb-1