JDBC Manual
The Ocient® 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 details about data extracting, see Data Extract Tool.
For a list of commands available in the JDBC CLI, see Commands Supported by the Ocient JDBC CLI Program.
Prerequisites
This software is required for the JDBC driver.
Driver Features
The Ocient JDBC connector supports these features as of the current version.
Invoke the Ocient JDBC CLI Program
If your system meets all the necessary prerequisites, you can run the JDBC CLI by using the Ocient JDBC JAR file. To do this, follow these steps.
Go to the Ocient Apache® Maven™ repository for all JDBC versions. For more information on which version to pick, see the Version Compatibility page.
For the JDBC version you want to use, download the JAR file with dependencies. This JAR file follows the format: ocient-jdbc4-<version number>-jar-with-dependencies.jar.
Move this JAR file to the directory where your Ocient System is installed.
From the shell terminal, run this command to launch the JDBC CLI.
This example runs JDBC version 2.10.
After launching, the JDBC CLI prompts you to enter your username and password.
The interface changes to the Ocient CLI.
Connect to your system from the JDBC using a connection string.
Assuming the standard port 4050, a self-signed certificate, and the SQL Node IP address 10.10.1.1, you can connect to the system database with the following connecting string.
The CLI responds with a connection message.
Now that you are connected to your system, you can execute any queries or commands.
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.
The JDBC CLI supports these options.
For supported commands, see Commands Supported by the Ocient JDBC CLI Program.
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.
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.
Connect Using JDBC
The Ocient JDBC driver supports connection properties that can be supplied using the CONNECT command in the JDBC CLI or as a properties object passed in a Java application.
JDBC URL Example
This connection string includes various connection properties that trail the login credentials.
Java DriverManager Example
Alternatively, you can use the DriverManager class to provide connection properties if you are using a JDBC connection as part of a Java application.
Supported JDBC Connection Properties
The JDBC driver supports these connection parameters.
JDBC Bulk Loading
For very large batches, the Ocient JDBC driver provides a high-speed bulk load path. When you enable bulk loading, the driver bypasses the standard multi-row insert operation and instead streams the batch data directly to the Loader Nodes in the cluster using SSH/SFTP. The data loads in the in-memory JSON Lines format using a temporary, system-generated Ocient pipeline, providing a massive performance boost for large-scale data ingestion.
Configuration
Follow these steps to configure bulk loading in your JDBC driver.
SSH Key Access and Node
JDBC bulk loading does not use password authentication. Instead, you must use SSH access for all Loader Nodes in the cluster.
To point the driver to your private SSH key file, use the bulkLoadSshKeyPath JDBC connection property. The client application must be able to read this file.
The driver automatically discovers available Loader Nodes by querying the sys.nodes and sys.service_roles system catalog tables.
Data Type Mapping
The JDBC driver supports all standard scalar types.
For complex types, Java SQL STRUCT (java.sql.Struct) types load as Ocient TUPLE types, and Java ARRAY (java.sql.Array) types load as Ocient ARRAY types.
Enable Bulk Loading
The JDBC driver disables bulk loading by default. To enable it, you must meet these conditions:
- Set the
enableBulkLoadconnection property totrue. - Use a parameterized
INSERTstatement that uses placeholders for values, e.g.,INSERT INTO customers (id, name, status) VALUES (?, ?, ?). For details, see Set Up Parameterized Insert Statements. - The total number of rows in the batch group meets or exceeds the
bulkLoadThresholdproperty.
For recommended configuration settings for Spark workloads, see Bulk Loading Best Practices.
Set Up Parameterized INSERT Statements
These steps demonstrate how to use a single parameterized INSERT statement using the Java PreparedStatement class. The parameterized statement binds different values for each row.
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 demonstrates how to utilize the Ocient JDBC driver to establish a connection to a database, construct a prepared SQL statement, execute the query, and iterate through the result set.
For supported classes and methods, see JDBC Classes and Methods.
Related Links
Commands Supported by the Ocient JDBC CLI Program
**Linux®is the registered trademark of Linus Torvalds in the U.S. and other countries.

