Skip to content

Latest commit

 

History

History
52 lines (37 loc) · 1.51 KB

File metadata and controls

52 lines (37 loc) · 1.51 KB
id driver_java
title Java

Use Java to access CovenantSQL

CovenantSQL provides Java SDK to access database instance through Adapter service.

Java SDK is compatible with JDBC4 specifications,and popular ORM like MyBatis is supported through JDBC interface.

Compatibility

Java SDK requires Java 1.7+.

Installation and quick start

Before using Java SDK, an adapter tool deployment is required, please see Deploy Adapter Service.

Now you can use jdbc:covenantsql://<adapter_endpoint>/<database_id> uri,replacing adapter_endpoint with adapter listen address,database_id with database id。

Maven

<dependencies>
    <dependency>
        <groupId>io.covenantsql</groupId>
        <artifactId>cql-java-connector</artifactId>
        <version>1.0.1</version>
    </dependency>
</dependencies>

Gradle

repositories {
    maven {
      url 'https://raw.github.com/CovenantSQL/cql-java-driver/mvn-repo'
    }
}

dependencies {
  compile 'io.covenantsql:covenantsql-java-connector:1.0-SNAPSHOT'
}

Examples

  1. JDBC Example
  2. MyBatis Example
  3. SpringBoot + MyBatis Project Example