Downloading / Integrating the JDBC Driver¶
The JDBC driver (
snowflake-jdbc) is provided as a JAR file, available as an artifact in Maven for download or integrating directly into your Java-based projects.
Before downloading or integrating the driver, you may want to first verify the version of the driver you are currently using. To verify your driver version, connect to Snowflake through a client application that uses the driver and check the driver version. If the application supports executing SQL queries, you can do this by calling the CURRENT_CLIENT function.
In this Topic:
For a list of the operating systems supported by Snowflake clients, see Operating System Support.
Downloading the Driver¶
To download the driver:
Go to the Maven Central Repository:
Click on the version that you need.
The most recent version is not always at the end of the list. Versions are listed alphabetically, not numerically. For example, 3.10.x comes after 3.1.x, not after 3.9.x.
Download the snowflake-jdbc-#.#.#.jar file. (You do not need to download the entire directory.)
Verifying the Driver Package Signature — Optional¶
To optionally verify the JDBC driver package signature:
Download and import the latest Snowflake GPG public key from the public keyserver:
$ gpg --keyserver hkp://keys.gnupg.net --recv-keys <GPG_KEY_ID>
<GPG_KEY_ID>, specify one of the following key IDs:
JDBC Driver Version
GPG Key ID
3.12.13 and higher
3.6.26 through 3.12.12
Up to 3.6.25
Download the GPG signature along with the bash installer and verify the signature. For example:
$ gpg --verify snowflake-jdbc-3.13.2.jar.asc snowflake-jdbc-3.13.2.jar gpg: Signature made Wed 22 Feb 2017 04:31:58 PM UTC using RSA key ID <gpg_key_id> gpg: Good signature from "Snowflake Computing <firstname.lastname@example.org>"
Specify the correct version numbers for the JDBC driver package you are verifying. Version 3.13.2 is used in this example for illustration purposes only. The latest available version of the driver may be higher.
Your local environment can contain multiple GPG keys; however, for security reasons, Snowflake periodically rotates the public GPG key. As a best practice, we recommend deleting the existing public key after confirming that the latest key works with the latest signed package:
$ gpg --delete-key "Snowflake Computing"
Integrating the Driver into a Maven Project¶
To integrate the driver into a Maven project, add the driver as a dependency to your
pom.xml file. For example:
<dependencies> ... <dependency> <groupId>net.snowflake</groupId> <artifactId>snowflake-jdbc</artifactId> <version>3.13.2</version> </dependency> ... </dependencies>
<version> tag specifies the version of the driver you wish to integrate. Note that version 3.13.2 is used in this example for illustration purposes only. The latest available
version of the driver may be higher.
The developer notes are hosted along with the source code on GitHub.
Adding the JNA Classes to Your Classpath¶
Connection caching for browser-based SSO and token caching for multi-factor authentication (MFA) require the use of the Java Native Access (JNA) classes to save data securely to the filesystem.
As of version 3.12.18 of the JDBC Driver, the JNA classes are no longer packaged in the JDBC Driver JAR file. In the JDBC Driver
pom.xml file, the dependencies on these classes are marked as optional.
If you need to use connection caching or token caching, you must add the following libraries to your classpath:
pom.xml file for
the JDBC Driver
specifies the version of the JNA classes that have been tested with the JDBC Driver. We recommend using this version (or the
the same major version) of the JNA classes.
For systems that use the aarch64 architecture (e.g. the Apple M1 chip), use version 5.7.0 or later of the JNA libraries. (JNA versions prior to v5.7.0 are not compatible with Windows and macOS systems that run on aarch64.)