将 java 与 Snowflake 连接时的安全本地存储问题

发布于 2025-01-11 02:15:55 字数 1339 浏览 5 评论 0原文

我收到此错误:

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

青萝楚歌 2025-01-18 02:15:55

基于浏览器的 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文