---
title: Connect Using JDBC
slug: EM6zizRG_cxwwnr3dbY-B
description: Learn how to set up and configure a JDBC connection to Ocient, ensuring secure and efficient data access for large-scale analytics.
docTags: 
createdAt: Thu Jul 21 2022 17:05:13 GMT+0000 (Coordinated Universal Time)
updatedAt: Mon Mar 30 2026 18:52:41 GMT+0000 (Coordinated Universal Time)
---

The JDBC driver can be executed in a command-line interface (CLI) mode or used directly in a program with standard JDBC methods. This example describes how to connect using the CLI mode. For details on using the JDBC driver in code, please see [Establishing a Connection](https://docs.oracle.com/javase/tutorial/jdbc/basics/connecting.html).&#x20;

## Step 1: Download the JDBC Driver

First, confirm the recommended version of the JDBC driver for your version of Ocient® by finding it in [Version Compatibility](<././Version Compatibility.md>). Download the correct JDBC driver from the Apache® Maven™ [repository](https://mvnrepository.com/artifact/com.ocient/ocient-jdbc4) by clicking on your preferred version, then selecting **view all**, and finally downloading the JAR file that is labeled with the pattern `ocient-jdbc4-<version number>-jar-with-dependencies.jar`.

Save this file to a convenient location on your client machine.

## Step 2: Run the JDBC CLI Program

To run the JDBC CLI Program, you must have Java® installed on your machine. For the version, see [Version Compatibility](<././Version Compatibility.md>). Next, run the following command to start the JDBC CLI Program. Assuming your JAR stored at `~/ocient-jdbc4-jar-with-dependencies.jar`.

```shell
 java -classpath ~/ocient-jdbc4-jar-with-dependencies.jar com.ocient.cli.CLI
```

The system prompts you to enter the username and password.&#x20;

```shell
 Username: test@system
 Password: fakepassword
```

**Example Response:**

```shell
 Ocient> _
```

The Ocient CLI prompt appears.

## Step 3: Connect

To connect, enter the connection string to your SQL Nodes. SQL Nodes install by default with a self-signed TLS certificate for encryption by default, and a custom certificate can be present. Depending on the TLS configuration, you can use `tls=unverified` (default) or `tls=on` for the required setting.

Assuming the standard port `4050`, a self-signed certificate, and the SQL Node IP Address of `10.10.1.1`, you can connect to the system database with the following connecting string:

```shell
 Ocient> connect to jdbc:ocient://10.10.1.1:4050/system;
```

**Example Response:**

```shell
 Connected to jdbc:ocient://10.10.1.1:4050/system 
 Ocient> _
```

You are now connected and can execute queries based on your user’s permissions. Try running: `select * from sys.tables;` to see what tables are defined.

For more details on using the JDBC driver and the CLI program, see the [JDBC Manual](<././Connection Driver Reference/JDBC Manual.md>).

:::hint{type="info"}
The system cancels any queries made with the JDBC driver if you perform any of these actions:

- Fetch the entire result set.
- Close the connection.
- Execute a new query on the same connection.
:::

## Related Links

[Connect to Ocient](<././Connect to Ocient.md>)

[Ocient Integrations](<./Ocient Integrations.md>)
