java连接sql2008,SQL2008为Windows认证方式,最后报错
Exceptioninthread"main"java.lang.UnsatisfiedLinkError:com.microsoft.sqlserver.jdbc.Au...
Exception in thread "main" java.lang.UnsatisfiedLinkError: com.microsoft.sqlserver.jdbc.AuthenticationJNI.GetDNSName(Ljava/lang/String;[Ljava/lang/String;Ljava/util/logging/Logger;)I
at com.microsoft.sqlserver.jdbc.AuthenticationJNI.GetDNSName(Native Method)
at com.microsoft.sqlserver.jdbc.AuthenticationJNI.GetDNSName(AuthenticationJNI.java:83)
at com.microsoft.sqlserver.jdbc.AuthenticationJNI.InitDNSNameAndPort(AuthenticationJNI.java:76)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.sendLogon(SQLServerConnection.java:2322)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.logon(SQLServerConnection.java:1905)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.access$000(SQLServerConnection.java:41)
at com.microsoft.sqlserver.jdbc.SQLServerConnection$LogonCommand.doExecute(SQLServerConnection.java:1893)
at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:4575)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1400)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:1045)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:817)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:700)
at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:842)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:207)
at text.com.Shujuku3.main(Shujuku3.java:17)求高手 展开
at com.microsoft.sqlserver.jdbc.AuthenticationJNI.GetDNSName(Native Method)
at com.microsoft.sqlserver.jdbc.AuthenticationJNI.GetDNSName(AuthenticationJNI.java:83)
at com.microsoft.sqlserver.jdbc.AuthenticationJNI.InitDNSNameAndPort(AuthenticationJNI.java:76)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.sendLogon(SQLServerConnection.java:2322)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.logon(SQLServerConnection.java:1905)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.access$000(SQLServerConnection.java:41)
at com.microsoft.sqlserver.jdbc.SQLServerConnection$LogonCommand.doExecute(SQLServerConnection.java:1893)
at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:4575)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1400)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:1045)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:817)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:700)
at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:842)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:207)
at text.com.Shujuku3.main(Shujuku3.java:17)求高手 展开
3个回答
展开全部
Exception in thread "main" java.lang.UnsatisfiedLinkError---关键是知橡java.lang中的不满足的连接错误异常。。这个异常,应该是数据库连接错误。。你改改数据库如下步骤:然后,打开数据库,首先用windows身份验证进入数据库,安全性-->登录名-->sa-->属性-->修改密码:改为以上密码sa,将选项“强制实行密码策略”勾掉;安全性-->登录名-->sa-->属性-->状态-->授权,启搭启旁用;鼠标右击在你数据库的对象管理资源管理器的根目录-->属性-->安全性-->选sql server和windows身份验证旁好模式
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询