我在 Windows 中有一個具有以下 Maven 配置的 Java 專案:
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>10.2.0.jre8</version>
</dependency>
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc_auth</artifactId>
<version>10.2.0.x64</version>
<type>dll</type>
</dependency>
以及以下 Hibernate 配置:
<property name="hibernate.connection.url">
jdbc:sqlserver://localhost;databaseName=<DBNAME>;
integratedSecurity=true;TrustServerCertificate=True;domain=<DOMAIN>
</property>
使用 運行應用程式時integratedSecurity=false,一切正常。但是,將其切換為會true導致以下錯誤:
This driver is not configured for integrated authentication
Unable to load authentication DLL
這里出了什么問題?
uj5u.com熱心網友回復:
事實證明,SQL Server JDBC 驅動程式中存在一個已知錯誤,即在切換到集成身份驗證時不使用 Maven 提供的 DLL。相反,JDBC 會嘗試從以下位置加載相同的 DLL:
C:\Program Files\Java\jdk-<version>\bin
復制mssql-jdbc_auth-10.2.0.x64.dll到該檔案夾??解決了問題,并且集成身份驗證現在可以作業。在微軟在他們的庫中修復這個錯誤之前,這似乎是唯一的選擇。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/439113.html
標籤:爪哇 sql服务器 休眠 windows-10
