SQL Server-使用Windows身份验证连接 [英] Sql Server - connect with windows authentication

查看:584
本文介绍了SQL Server-使用Windows身份验证连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须通过Windows身份验证连接到sql服务器

i must connect to a sql server with windows authentication

sql服务器在机器192.168.3.6上 Web服务器(客户端)在我的机器上192.168.3.10

sql server is on machine 192.168.3.6 web server (client) is on my machine 192.168.3.10

我正在使用JTDS驱动程序

I'm using JTDS driver

dbUrl=jdbc:jtds:sqlserver://192.168.3.6:1099/db_test;instance=test
Connection con = DriverManager.getConnection( dbUrl, "", "" );

我有SQL Server管理员用户的用户名和密码!

I have username and password of administrator user of sql server !

我也将ntlmauth.dll放入c:\windowsc:\windows\system32中,但我总是出错:

I also put ntlmauth.dll into c:\windows and c:\windows\system32 and I have always error:

java.sql.SQLException:用户'(null)'登录失败.原因:否 与受信任的SQL Server连接关联.

java.sql.SQLException: Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.

有什么办法解决我的问题吗? 非常感谢

Any idea to solve my problem ? Thank you very much

推荐答案

请参阅jTDS常见问题解答 http://jtds .sourceforge.net/faq.html

See jTDS FAQ http://jtds.sourceforge.net/faq.html

您将必须通过useNTLMv2=truedomain=yourdomain

这篇关于SQL Server-使用Windows身份验证连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆