gpt4 book ai didi

sql-server - 如何使用 JDBC 驱动程序的集成安全性连接到 SQL Server?

转载 作者:行者123 更新时间:2023-12-02 09:23:16 25 4
gpt4 key购买 nike

我正在尝试使用 Microsoft 的 SQL Server 2005 的 JDBC 驱动程序连接到我公司的 SQL 服务器。我的连接字符串如下所示:

jdbc:sqlserver://HOSTNAME;integratedSecurity=true;database=DATABASE;

驱动程序抛出异常:

Invalid integratedSecurity property value:true

使用“yes”会给出不同的错误消息,指示“yes”不是 bool 属性的有效选项。

如何使用集成安全性进行连接?

最佳答案

检查这些instructions ,另外 - 您是否在同一个域中(调用者和服务器?)

引自那里:

The JDBC driver supports the use of Type 2 integrated authentication on Windows operating systems through the integratedSecurity connection string property. To use integrated authentication, copy the sqljdbc_auth.dll file to a directory on the Windows system path on the computer where the JDBC driver is installed.

The sqljdbc_auth.dll files are installed in the following location:

<installation directory>\sqljdbc_<version>\<language>\auth\

Note:

If you are running a 32-bit Java Virtual Machine (JVM), use the sqljdbc_auth.dll file in the x86 folder, even if the operating system is the x64 version. If you are running a 64-bit JVM on a x64 processor, use the sqljdbc_auth.dll file in the x64 folder. If you are running a 64-bit JVM on a IA-64 processor, use the sqljdbc_auth.dll file in the IA64 folder.

Alternatively you can set the java.libary.path system property to specify the directory of the sqljdbc_auth.dll. For example, if the JDBC driver is installed in the default directory, you can specify the location of the DLL by using the following virtual machine (VM) argument when the Java application is started:

-Djava.library.path=C:\Microsoft SQL Server 2005 JDBC Driver\sqljdbc_<version>\enu\auth\x86

关于sql-server - 如何使用 JDBC 驱动程序的集成安全性连接到 SQL Server?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4629718/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com