将 java 与 Snowflake 连接时的安全本地存储问题
我收到此错误:
net.snowflake.client.core.CredentialManager initSecureStorageManager
信息:安全本地存储服务需要 JNA jar 文件。请遵循 Snowflake JDBC 说明来获取安全本地存储功能。回到正常流程。
net.snowflake.client.core.CredentialManager fillCachedCredential
信息:安全本地存储服务需要 JNA jar 文件。请遵循 Snowflake JDBC 说明来获取安全本地存储功能。回到正常流程。
如何将这些文件添加到我的项目中?
这是我的连接属性文件:
hostname=jdbc:snowflake://ya189.ap-south-1.aws.snowflakecomputing.com/
user=
password=
account=ya189.ap-south-1
database=DEMO_DB
role=
warehouse=COMPUTE_WH
schema=PUBLIC
IS_ENCRYPTED=true
authenticator=externalbrowser
我已将 JNA 包含在我的 pom.xml 中:
<dependency>
<groupId>net.snowflake</groupId>
<artifactId>snowflake-jdbc</artifactId>
<version>3.13.15</version>
</dependency>
<!-- https://mvnrepository.com/artifact/net.java.dev.jna/jna -->
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna</artifactId>
<version>5.9.0</version>
</dependency>
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna-platform</artifactId>
<version>5.9.0</version>
</dependency>
I am receiving this error:
net.snowflake.client.core.CredentialManager initSecureStorageManager
INFO: JNA jar files are needed for Secure Local Storage service. Please follow the Snowflake JDBC instruction for Secure Local Storage feature. Fall back to normal process.
net.snowflake.client.core.CredentialManager fillCachedCredential
INFO: JNA jar files are needed for Secure Local Storage service. Please follow the Snowflake JDBC instruction for Secure Local Storage feature. Fall back to normal process.
How do I add these files in my project?
This is my connection properties files:
hostname=jdbc:snowflake://ya189.ap-south-1.aws.snowflakecomputing.com/
user=
password=
account=ya189.ap-south-1
database=DEMO_DB
role=
warehouse=COMPUTE_WH
schema=PUBLIC
IS_ENCRYPTED=true
authenticator=externalbrowser
I have included JNA in my pom.xml:
<dependency>
<groupId>net.snowflake</groupId>
<artifactId>snowflake-jdbc</artifactId>
<version>3.13.15</version>
</dependency>
<!-- https://mvnrepository.com/artifact/net.java.dev.jna/jna -->
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna</artifactId>
<version>5.9.0</version>
</dependency>
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna-platform</artifactId>
<version>5.9.0</version>
</dependency>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
基于浏览器的 SSO 的连接缓存和多重身份验证 (MFA) 的令牌缓存需要使用 Java Native Access (JNA) 类将数据安全地保存到文件系统。
从 JDBC 驱动程序 3.12.18 版本开始,JNA 类不再打包在 JDBC 驱动程序 JAR 文件中。在 JDBC 驱动程序 pom.xml 文件中,这些类的依赖项被标记为可选。
如果需要使用连接缓存或令牌缓存,则必须将以下库添加到类路径中。
JDBC 驱动程序 的 pom.xml 文件指定了已使用 JDBC 驱动程序进行测试的 JNA 类。我们建议使用此版本(或相同的主要版本)的 JNA 类。
有关更多信息,请阅读 这里
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.
The 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 same major version) of the JNA classes.
For more information read here