JDBC 驱动程序的 Java 要求¶
Snowflake JDBC 驱动程序需要 Java LTS(长期支持)版本 1.8 或更高版本。如果客户端计算机上未安装所需的最低 Java 版本,则 JDBC 驱动程序安装后,必须安装 Oracle Java 或 OpenJDK。
Note
If you use JDK 1.8 u91 or earlier, or if you use a custom trust store, please read the DigiCert Global Root G2 certificate authority (CA) TLS certificate updates (https://community.snowflake.com/s/article/check-impact-from-digicert-g2-certificate-update) Knowledge Base article for information about updating the trust store with the required certificate.
Oracle Java¶
Oracle Java 目前支持 Java 8。
OpenJDK¶
OpenJDK 是 Java 的开源实现,可为各种 Linux 环境提供 JDK 8 包。非 Linux 环境或更高 Java 版本的软件包只能通过第三方获得。
客户端数据加密要求
The JDBC driver uses the AES specification to encrypt files uploaded to Snowflake stages (using PUT) and decrypt downloaded files (via GET). The driver automatically encrypts staged files using 128-bit keys, but also supports encrypting files using 256-bit keys for a higher level of AES encryption.
To use 256-bit keys instead of the default 128-bit keys for encryption of staged files, your account administrator must set the CLIENT_ENCRYPTION_KEY_SIZE account parameter. For more information about setting parameters for your account, see Parameter management.
但是,要使用 256 位密钥加密暂存文件,JDBC 驱动程序使用的 Java 运行时环境 (JRE) 需要在安装 JDBC 驱动程序的每台计算机上安装 Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files:
- Oracle Java 不包含策略文件;必须单独下载和安装(见下文)。
- OpenJDK 自动包含策略文件;无需执行其他任务。
下一部分将提供有关安装 Oracle Java 策略文件的说明。
为 Oracle Java 安装 JCE Unlimited Strength Jurisdiction Policy Files¶
Attention
每次在客户端计算机上安装新版本的 Oracle Java 时,都可能需要重新安装策略文件,如下所述。
要安装 Oracle Java 的策略文件,请执行以下操作:
-
下载适合您的 Oracle Java 版本的策略文件。
-
安装文件。根据您的环境,您可通过以下方式安装文件:
如果策略文件未安装或安装不正确(即 JRE 无法找到文件),系统将返回错误,其中包括 JRE 期望找到策略文件的目录。然后您可以将文件复制到错误中指定的目录。
To get the latest version of the driver, download it from the Maven Central Repository. For more information, see Downloading / integrating the JDBC Driver.
- If a single version of Java is installed on your client machine, put the two
.jarfiles in thejre/lib/securitysub-directory of your Java installation as described in theREADME.txtfile included with the policy files.
例如,在安装了 Java 8 的 macOS 上,目录应为:
/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/jre/lib/security
- If multiple versions of Java are installed, the JDBC driver will automatically locate a Java installation to use; however, we recommend using JAVA_HOME to explicitly specify the version to use in your
environment:
- If JAVA_HOME is set, put the
.jarfiles in thejre/lib/securitydirectory for the Java installation referenced in JAVA_HOME. - If JAVA_HOME is not set, we recommend putting the
.jarfiles in thelib/securitydirectory for each installed JRE.
- If JAVA_HOME is set, put the
- 安装文件后,您可能需要退出客户端并重新登录。