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

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

问题描述

我必须使用 Windows 身份验证连接到 sql 服务器

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

我正在使用 JTDS 驱动程序

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

我有sql server管理员用户的用户名和密码!

我还将 ntlmauth.dll 放入 c:windowsc:windowssystem32 中,但我总是出错:<块引用>

java.sql.SQLException: 用户 '(null)' 登录失败.理由:不是与受信任的 SQL Server 连接相关联.

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

解决方案

查看 jTDS FAQ http://jtds.sourceforge.net/faq.html

你必须通过 useNTLMv2=truedomain=yourdomain

i must connect to a sql server with windows authentication

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

I'm using JTDS driver

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

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

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

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

解决方案

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

you will have to pass useNTLMv2=true and domain=yourdomain

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

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