用户未与受信任的SQL Server连接关联 [英] The user is not associated with a trusted SQL Server connection
问题描述
我编写了这样的代码来连接sqlserver database.i加载驱动程序类,但是我没有得到连接。
i wrote the code like this to connect sqlserver database.i load the driverclass,but iam not getting connection.
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
System.out.println("class Loaded");
connection =
DriverManager.getConnection(
"jdbc:sqlserver://10.171.160.114:2001",
"XXXXXX",
"XXXXXX");
System.out.println("connected");
我收到此错误用户未与受信任的SQL Server连接关联。。请参阅建议非常感谢。
iam getting this error " The user is not associated with a trusted SQL Server connection. ".please advice me on this.any help greately appreciated.
推荐答案
SQL服务器已配置为在Windows身份验证模式下运行(Windows身份验证) )并且不允许使用SQL帐户。右键单击Management Studio中的SQL Server节点,然后选择属性。在出现的对话框中转到安全选项卡,并确保选择SQL Server和Windows身份验证模式
The SQL server has been configured to operate in "Windows Authentication Mode (Windows Authentication)" and doesn't allow the use of SQL accounts. Right click on your SQL Server node in Management Studio and choose Properties. On the dialog that appears go to security tab and make sure that "SQL Server and Windows Authentication mode" is selected
这篇关于用户未与受信任的SQL Server连接关联的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!