简体   繁体   English

如何在 Eclipse 中为 SQL Server JDBC 驱动程序配置集成身份验证?

[英]How do I configure integrated authentication for SQL Server JDBC driver in Eclipse?

I am trying to create a new database connection to SQL Server in Eclipse, and I am getting the following error:我正在尝试在 Eclipse 中创建到 SQL Server 的新数据库连接,但出现以下错误:

*com.microsoft.sqlserver.jdbc.SQLServerException: This driver is not configured for integrated authentication. ClientConnectionId:f76bec48-e9f8-4a03-aea3-4840e8674267*

Environment details:环境细节:

  • Windows Server 2016 Datacenter (x64) Windows Server 2016 数据中心 (x64)
  • Microsoft SQL Server 2014 (SP2-GDR) Microsoft SQL Server 2014 (SP2-GDR)
  • Eclipse 4.9.0 JRE 1.8.0_191 Eclipse 4.9.0 JRE 1.8.0_191
  • Driver: sqljdbc 6.0驱动程序:sqljdbc 6.0

Steps that led to the error:导致错误的步骤:

  1. Opened Data Source Explorer and added a new Database Connection打开数据源资源管理器并添加一个新的数据库连接
  2. Chose Microsoft SQL Server 2008 JDBC Driver (I was not able to get any of the newer ones to work; it wouldn't let me enter any properties).选择 Microsoft SQL Server 2008 JDBC 驱动程序(我无法使用任何较新的驱动程序;它不会让我输入任何属性)。
  3. Pointed Eclipse to my JAR file (sqljdbc42.jar)将 Eclipse 指向我的 JAR 文件 (sqljdbc42.jar)
  4. Entered the database properties and chose "Use integrated authentication"进入数据库属性并选择“使用集成身份验证”
  5. Clicked "Test Database Connection"单击“测试数据库连接”

This is where I get the error noted above.这是我得到上面提到的错误的地方。


What I have tried to fix the error:我试图解决的错误:

  • I read that this error is often due to the absence of the sqljdbc_auth.dll file in the Windows system path, so I moved the x64 version of this file to C:\\Windows\\System32 (and I also tried C:\\Windows\\SysWOW64 for good measure), but, same result.我读到这个错误通常是由于 Windows 系统路径中缺少 sqljdbc_auth.dll 文件,所以我将这个文件的 x64 版本移动到 C:\\Windows\\System32(我也尝试了 C:\\Windows\\SysWOW64很好的衡量标准),但是,相同的结果。
  • I also found that adding the sqljdbc_auth.dll file to the java.library.path value can be a potential fix, but I am not sure how to do that since I am not actually in a project at this point;我还发现将 sqljdbc_auth.dll 文件添加到 java.library.path 值可能是一个潜在的修复,但我不知道该怎么做,因为此时我实际上不在项目中; I am in the Data Source Explorer trying to add a new connection.我在数据源资源管理器中尝试添加新连接。

Every time I try to ping this connection, I get the same error:每次尝试 ping 此连接时,都会遇到相同的错误:

*com.microsoft.sqlserver.jdbc.SQLServerException: This driver is not configured for integrated authentication. ClientConnectionId:733c823d-b740-4f70-89a4-4109a03dad58*

However, I am able to connect to this server/database with Windows Authentication via SQL Server Management Studio.但是,我可以通过 SQL Server Management Studio 使用 Windows 身份验证连接到此服务器/数据库。

Thanks for your help!谢谢你的帮助!

Late response for anyone who might still run into this... I had to drop a copy of the mssql-jdbc_auth- XYX .x64.dll file (from the driver's sqljdbc_ X.Y \\enu\\auth\\x64 folder) into the java.library.path on my Windows 10 machine and restart eclipse.对于可能仍然遇到此问题的任何人的迟到回应......我不得不将 mssql-jdbc_auth- XYX .x64.dll 文件的副本(来自驱动程序的 sqljdbc_ X.Y \\enu\\auth\\x64 文件夹)放入 java.library .path 在我的 Windows 10 机器上并重新启动 eclipse。 After that, I was able to connect using the integrated security.之后,我能够使用集成安全进行连接。 BTW, the java.library.path should, in part, reflect your Windows environment's PATH variable.顺便说一句, java.library.path 应该部分反映您的 Windows 环境的 PATH 变量。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 是否可以使用SQL Server JDBC驱动程序进行代理身份验证? - Is possible to do proxy authentication using SQL Server JDBC driver? JDBC SQLServerException:“此驱动程序未配置集成身份验证。” - JDBC SQLServerException: "This driver is not configured for integrated authentication." java spring:为具有集成身份验证的sql server配置属性 - java spring: configure properties for sql server with integrated authentication 似乎无法将JDBC sql server驱动程序连接到java eclipse项目 - Cant seem to connect the JDBC sql server driver to java eclipse project RJDBC SQL 查询:“此驱动程序未配置为集成身份验证” - RJDBC SQL queries: "This driver is not configured for integrated authentication" SQL Server 2014的JDBC驱动程序 - JDBC driver for SQL server 2014 此驱动程序未配置为集成身份验证 - This driver is not configured for integrated authentication 如何使用 JDBC 连接到 SQL Server 2008 数据库? - How do I connect to a SQL Server 2008 database using JDBC? 如何在MS SQL Server 2008 Express中使用MS JDBC驱动程序? - How can I use the MS JDBC driver with MS SQL Server 2008 Express? 如何使用Java中的Postgres JDBC驱动程序获取导致SQLException的sql语句? - How do I get at the sql statement that caused an SQLException using the Postgres JDBC driver in Java?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM