Downloading / integrating the JDBC Driver¶
The Snowflake JDBC Driver is a Java library that is built on the Universal Core. It is published as artifacts in the
Maven Central Repository, under the group ID net.snowflake. You can integrate it into a Java project with Maven or Gradle, or download a JAR file.
To move an existing application from JDBC Driver 4.x to 5.x, see Migrating from JDBC Driver 4.x to 5.x.
Choose a package¶
| Artifact | Contents | Use it when |
|---|---|---|
snowflake-jdbc-native with a platform classifier | The driver classes and the native library for one platform. Other dependencies resolve from the POM file. | You build with Maven or Gradle for a known platform. This is the smaller package. |
snowflake-jdbc-native-all | The driver classes, their dependencies, and the native library for every available platform in one JAR file. | You download the JAR file yourself, or one JAR file has to run on more than one platform. |
snowflake-jdbc-native-fips with a platform classifier | The same driver classes as the standard package, with a native library built against the AWS-LC FIPS module. | You need a FIPS build for one platform. |
snowflake-jdbc-native-all-fips | The same as snowflake-jdbc-native-all, with only the FIPS native libraries. | You need a FIPS build in one JAR file. |
The classifiers are linux-x86_64, linux-aarch_64, osx-x86_64, osx-aarch_64, windows-x86_64, and windows-aarch_64. The FIPS packages are not available for
musl-based Linux distributions or Windows ARM64. For the platforms that each package supports, see Requirements for the JDBC Driver. For what a FIPS build is and
isn’t, see FIPS 140-3 considerations for drivers built on the Universal Core.
Important
snowflake-jdbc-native without a classifier contains no native library, and the driver doesn’t run. Always set a classifier, or use
snowflake-jdbc-native-all. Maven and Gradle don’t select the classifier for you.
Don’t leave snowflake-jdbc, snowflake-jdbc-fips, or snowflake-jdbc-thin on the classpath. All of these drivers register the jdbc:snowflake: URL, and
DriverManager uses whichever one it finds first.
Integrate the driver into a Maven project¶
To integrate the driver into a Maven project, add it as a dependency to your pom.xml file. Each example uses version 5.0.0. A later version of the
driver might be available.
Use a platform classifier¶
The os-maven-plugin extension sets ${os.detected.classifier} to the platform of the machine that runs the build:
Then add the dependency:
<dependency>
<groupId>net.snowflake</groupId>
<artifactId>snowflake-jdbc-native</artifactId>
<version>5.0.0</version>
<classifier>${os.detected.classifier}</classifier>
</dependency>If you build for a fixed platform, set the classifier to a value from the list above, such as linux-x86_64, and skip the extension.
Use the package for all platforms¶
<dependency>
<groupId>net.snowflake</groupId>
<artifactId>snowflake-jdbc-native-all</artifactId>
<version>5.0.0</version>
</dependency>Use a FIPS package¶
Use one of the following dependencies. The platform-specific dependency needs the extension from the previous section or a fixed classifier.
- Platform-specific:
<dependency> <groupId>net.snowflake</groupId> <artifactId>snowflake-jdbc-native-fips</artifactId> <version>5.0.0</version> <classifier>${os.detected.classifier}</classifier> </dependency> - All platforms:
<dependency> <groupId>net.snowflake</groupId> <artifactId>snowflake-jdbc-native-all-fips</artifactId> <version>5.0.0</version> </dependency>
Integrate the driver into a Gradle project¶
To integrate the driver into a Gradle project, add it as a dependency to your build.gradle file. Each example uses version 5.0.0. A later version of the
driver might be available.
Use a platform classifier¶
The osdetector plugin sets osdetector.classifier to the platform of the machine that runs the build:
Then add the dependency:
implementation 'net.snowflake:snowflake-jdbc-native:5.0.0:${osdetector.classifier}'If you build for a fixed platform, set the classifier to a value from the list above, such as linux-x86_64, and skip the plugin.
Use the package for all platforms¶
implementation 'net.snowflake:snowflake-jdbc-native-all:5.0.0'Use a FIPS package¶
- Platform-specific:
implementation 'net.snowflake:snowflake-jdbc-native-fips:5.0.0:${osdetector.classifier}' - All platforms:
implementation 'net.snowflake:snowflake-jdbc-native-all-fips:5.0.0'
Download a JAR file¶
If you don’t use a build tool, download the self-contained snowflake-jdbc-native-all package. The platform-specific packages don’t include their
dependencies, so use them with Maven or Gradle.
-
Go to the Maven Central Repository for the package.
-
Select the directory for the version that you need. The most recent version (5.0.0) is not always at the end of the list. Versions are listed alphabetically, not numerically. For example, 5.10.0 comes after 5.1.0, not after 5.9.0.
-
Download the
snowflake-jdbc-native-all-#.#.#.jarfile, or thesnowflake-jdbc-native-all-fips-#.#.#.jarfile for the FIPS package, where#.#.#is the version number. -
Add the JAR file to the classpath of your application.
Verify the driver version¶
To find the version of the driver that your application uses, connect to Snowflake and call DatabaseMetaData.getDriverVersion(). If the application
supports executing SQL queries, you can also call the CURRENT_CLIENT function.
The JAR files don’t have a main class, so java -jar <file>.jar --version doesn’t print the version.