Java Driver for CovenantSQL
CovenantSQL-Java-Connector is a Type 4 Java JDBC driver for CovenantSQL database querying.
To add a dependency using Maven, use the following:
<dependency>
<groupId>io.covenantsql</groupId>
<artifactId>cql-java-connector</artifactId>
<version>1.0.1</version>
</dependency>
To add a dependency using Gradle:
repositories {
maven {
url 'https://raw.github.com/CovenantSQL/cql-java-driver/mvn-repo'
}
}
dependencies {
compile 'io.covenantsql:covenantsql-java-connector:1.0-SNAPSHOT'
}
Configure the dataSource like the following example:
<dataSource type="POOLED">
<property name="driver" value="io.covenantsql.connector.CovenantDriver"></property>
<property name="url" value="jdbc:covenantsql://${host}:${port}/${database}"></property>
<property name="driver.key_path" value="${key_path}"></property>
<property name="driver.cert_path" value="${cert_path}"></property>
<property name="driver.sslmode" value="${sslmode}"></property>
<property name="driver.ssl" value="${ssl}"></property>
</dataSource>
Explanation:
io.covenantsql.connector.CovenantDriver
as the driver class.host
variable with the adapter host address.port
variable with the adapter port.database
variable with the adapter.key_path
variable with the https certificate private key path.cert_path
variable with the https certificate file path.sslmode
variable to use none/strict mode for https certificate check.ssl
variable to true/false to enable/disable https adapter connection.You can see a runnable example Here.