无法从Java应用程序连接到SQL EXPRESS 2010中的数据库

时间:2017-06-27 15:09:30

标签: java netbeans

我在尝试从Java应用程序(Netbeans IDE 8.0.2)连接到SQL EXPRESS 2010中的数据库时遇到问题。我知道连接参数是正确的,因为如果我尝试从Netbeans运行应用程序的连接它工作正常,但如果我尝试使用.jar运行应用程序的连接,try-catch会显示以下错误:

Com.microsoft.sqlserver.jdbc.SQLServerException: This driver is not configured for integrated authentication. ClientConnectionId: ad61b2cf-071d-4561-9416-c31f8e918a34
at com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(SQLServerConnection.java:2400)
    at com.microsoft.sqlserver.jdbc.AuthenticationJNI.<init>(AuthenticationJNI.java:68)
    at com.microsoft.sqlserver.jdbc.SQLServerConnection.logon(SQLServerConnection.java:3132)
    at com.microsoft.sqlserver.jdbc.SQLServerConnection.access$100(SQLServerConnection.java:43)
    at com.microsoft.sqlserver.jdbc.SQLServerConnection$LogonCommand.doExecute(SQLServerConnection.java:3123)
    at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7505)
    at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:2445)
    at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:1981)
    at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:1628)
    at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectInternal(SQLServerConnection.java:1459)
    at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:773)
    at com.microsoft.sqlserver.jdbc.SQLServerDataSource.getConnectionInternal(SQLServerDataSource.java:704)
    at com.microsoft.sqlserver.jdbc.SQLServerDataSource.getConnection(SQLServerDataSource.java:54)
    at sqlserver.SqlServer.checkNewConnection(SqlServer.java:67)
    at view.Dialogs.configConnection(Dialogs.java:269)
    at demosocketserial.DemoSocketSerial.checkConnection(DemoSocketSerial.java:211)
    at demosocketserial.DemoSocketSerial.main(DemoSocketSerial.java:41)
Caused by: java.lang.UnsatisfiedLinkError: no sqljdbc_auth in java.library.path
    at java.lang.ClassLoader.loadLibrary(Unknown Source)
    at java.lang.Runtime.loadLibrary0(Unknown Source)
    at java.lang.System.loadLibrary(Unknown Source)
    at com.microsoft.sqlserver.jdbc.AuthenticationJNI.<clinit>(AuthenticationJNI.java:41)
    ... 15 more

我已经将sqljdbc_auth.dll文件复制到Windows System32文件夹(这就是我从Netbeans成功连接的方式),但是我没有从“dist”文件夹中的.jar中获取该程序。

0 个答案:

没有答案