Connect with Java/JDBC

You can connect from Java/JDBC-based applications to SingleStore using the following drivers/connectors:

  • The SingleStore JDBC Driver

  • MariaDB Connector/J (JDBC)

For most JDBC use cases, SingleStore recommends The SingleStore JDBC Driver.

You can use GSSAPI (Generic Security Services Application Program Interface) authentication via the JDBC client libraries. See JDBC Connector Setup Instructions With Optional GSSAPI for more information.

The SingleStore JDBC Driver

The SingleStore JDBC driver is compatible with JDBC 4.2. You can use this driver to connect applications developed in Java 21, Java 17, Java 11, and Java 8 to SingleStore databases.

Refer to The SingleStore JDBC Driver for detailed information on how to install, configure, and connect using this driver.

MariaDB Connector/J (JDBC) Version 2.4.0 (LGPLv2.1)

You can also use the MariaDB Connector/J v2.4.0 to connect to your SingleStore database.

Note

To enable/promote connector compatibility, SingleStore identifies itself as MySQL version x.x.x compatible. The compatibility version may vary depending on the SingleStore version in use.

To specify a MySQL compatibility version, use the compat_version variable. For example,

SET GLOBAL compat_version = '5.6.4';

Binary

URL

Platform independent

mariadb-java-client-2.4.0.jar

Source code: mariadb-java-client-2.4.0-sources.jar

In this section

Last modified: September 25, 2024

Was this article helpful?

Verification instructions

Note: You must install cosign to verify the authenticity of the SingleStore file.

Use the following steps to verify the authenticity of singlestoredb-server, singlestoredb-toolbox, singlestoredb-studio, and singlestore-client SingleStore files that have been downloaded.

You may perform the following steps on any computer that can run cosign, such as the main deployment host of the cluster.

  1. (Optional) Run the following command to view the associated signature files.

    curl undefined
  2. Download the signature file from the SingleStore release server.

    • Option 1: Click the Download Signature button next to the SingleStore file.

    • Option 2: Copy and paste the following URL into the address bar of your browser and save the signature file.

    • Option 3: Run the following command to download the signature file.

      curl -O undefined
  3. After the signature file has been downloaded, run the following command to verify the authenticity of the SingleStore file.

    echo -n undefined |
    cosign verify-blob --certificate-oidc-issuer https://oidc.eks.us-east-1.amazonaws.com/id/CCDCDBA1379A5596AB5B2E46DCA385BC \
    --certificate-identity https://kubernetes.io/namespaces/freya-production/serviceaccounts/job-worker \
    --bundle undefined \
    --new-bundle-format -
    Verified OK