Skip to main content

Before you begin

The CData CLI requires Java 17 or later. On Windows, the installer can automatically install Adoptium JRE 17 via winget if no compatible JRE is detected.

Windows

Run the following command in PowerShell:
The installer:
  1. Checks for a compatible JRE. If none is found, installs Adoptium JRE 17 using winget.
  2. Installs the CData CLI to %APPDATA%\Programs\CData\CData CLI tool\.
  3. Adds the install directory to your PATH.
After installation, open a new terminal and run:

macOS

Run the following command in your terminal:
After installation, open a new terminal and run:

Linux

Run the following command in your terminal:
After installation, open a new terminal and run:

Adding drivers

Driver library directory

The CData CLI stores drivers in a single driver library directory and reads drivers only from that directory. By default, this is a per-user location, so you can reuse a driver in any project without downloading and activating it again: To use a different directory, use either of the following. The CLI checks them in this order:
  1. The -l, --lib <directory> option on a command. For example, cdatacli drivers list -l ./lib.
  2. The CDATACLI_HOME environment variable. If the variable is set to a valid directory path, the CLI uses that directory. If it is empty or not a valid path, the CLI uses the default location.

Download a driver

The easiest way to add a driver is to download it with the CLI. First, search CData’s published driver catalog to find a driver’s artifact ID:
Then download the driver by its artifact ID. The jar is saved to the driver library directory by default — the same location the CLI reads drivers from:
Use --output <dir> to save the jar to a different directory, or --url <jar-url> to download from a direct URL instead.

Add a driver manually

You can also place driver JAR files yourself. Copy your CData JDBC driver JAR files to the driver library directory. To verify a driver is available:
To use a driver in a different directory, such as a project folder, pass that directory with -l:

Third-party dependencies

Some CData drivers require third-party libraries that CData cannot bundle because of licensing restrictions. These dependencies may include a JAR file and, in some cases, a native library for your platform. Place these files in the driver library directory alongside the driver. The CData CLI automatically adds any non-CData JAR in that directory to the driver’s classpath and adds the directory to the Java native library path, so the driver can load both the JAR and its native library at runtime.

Next steps