Connection Driver Reference

JDBC Manual

The JDBC Driver and command-line interface (CLI) enable you to connect to Ocient using a JDBC connection. Ensure that you meet the prerequisites before using the Ocient JDBC Driver. Then, invoke the CLI program, configure options, and connect to a database using the driver.

You can also use the data extract tool to extract a result set to delimited files in the target location. For more information on data extracting, see Data Extract Manual.

For a list of commands available in the JDBC CLI, see Commands Supported by the Ocient JDBC CLI Program .

Prerequisites

Software

Version

Ocient

Use the latest Ocient system version.

OS

, , or .



Use the latest version of each OS system.



Java 8+

Driver Features

The Ocient JDBC connector supports these features as of the current version.

Unicode Support

UTF-8

Isolation Levels

Ocient does not support transactions at this time.

Data Types

Supports all Ocient Data Types.

Security / Encryption

Uses SSL/TLS to connect to the Ocient system.



TLS protocol is available as a JDBC Configuration Option.

Invoke the Ocient JDBC CLI Program

You can invoke the CLI using these commands.

Shell


The user can supply no credentials, a username only, or a username and password. Throughout this document, angle brackets (< >) indicate name parameters chosen by the user and square brackets ([ ]) indicate that the enclosed text is optional. Parentheses are literal.

If you do not specify the username or password, the system prompts you to enter it on startup.

Invoke the Ocient JDBC CLI Program with the JAR File Only

You can invoke the JDBC CLI with the Ocient JDBC JAR file only. Java 8 or later is required. You can download Ocient JDBC JAR files at the Maven repository.

The system requires the JAR file with dependencies for the CLI program. The JAR file name must be: ocient-jdbc4-<version number>-jar-with-dependencies.jar. After you download the file, this command invokes the JDBC CLI.

Shell


This command shows the full example using the 2.10 version of the JAR file in the current working directory.

Shell


For Java version 1.8.0_144, download and install the Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files 8.

JDBC CLI Configuration Options

The JDBC CLI reads a configuration file consisting of key-value pairs located at ~/.ocient-cli-configuration with this format.

Shell


This option is supported.

Option

Comments

Default

cliIdleTimeoutMinutes

Configures the idle timeout for the CLI. The CLI rejects subsequent commands and exits the process after cliIdleTimeoutMinutes minutes of inactivity.

0 if left unspecified or the configuration file does not exist.

Use the Ocient JDBC Driver in Java Programs

First, you must load the Ocient driver class with this statement in a Java program using the JDBC driver.

Java


The driver class is located in the JDBC driver JAR file named ocient-jdbc4.jar and must be available in the CLASSPATH defined for the program.

Connection Encryption (SSL/TLS)

The JDBC driver can use SSL/TLS to connect to Ocient, causing all traffic to be encrypted. Specify the tls property on the connect statement to enable TLS support. The tls property supports these values.

unverified Traffic on the connection is encrypted, but no verification is done on the certificate received from the Ocient system.

on Traffic is encrypted, and the JDBC client must be able to verify the certificate received from the Ocient system.

The TLS on mode requires that the client knows the Certificate Authority that signed the certificate provided by the Ocient system. Typically, this mode requires either that the certificate is signed by a well known certificate authority, or the Certificate Authority certificate has been imported into the truststore of the Java system. The Java keytool utility is used to manipulate a Java truststore.

Secure Connections Using TLS discusses how you can configure user-defined certificates for the Ocient system.

Sample Java Program Using the Ocient JDBC Driver

This sample program illustrates how to use the Ocient JDBC driver to connect to a database, build a prepared SQL statement, execute the query, and loop through the result set.

Java


For supported classes and methods, see Supported JDBC Classes and Methods.

Related Links