错误讯息:
创建与DB的连接: 创建SQL连接:
sun.jdbc.odbc.JdbcOdbcDriver
com.microsoft.sqlserver.jdbc.SQLServerDriver
com.microsoft.sqlserver.jdbc.SQLServerException: Login failed for user 'sa'.
ClientConnectionId:3978d1be-ff31-4ab5-9ce1-89719d44a54f
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:216)
at com.microsoft.sqlserver.jdbc.TDSTokenHandler.onEOF(tdsparser.java:254)
at com.microsoft.sqlserver.jdbc.TDSParser.parse(tdsparser.java:84)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.sendLogon(SQLServerConnection.java:2908)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.logon(SQLServerConnection.java:2234)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.access$000(SQLServerConnection.java:41)
at com.microsoft.sqlserver.jdbc.SQLServerConnection$LogonCommand.doExecute(SQLServerConnection.java:2220)
at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:5696)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1715)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:1326)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:991)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:827)
at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:1012)
at DatabaseConnectivity.getDBConnection(DatabaseConnectivity.java:65)
at DatabaseConnectivity.main(DatabaseConnectivity.java:74)
这个问题的解决方案是什么。?
答案 0 :(得分:1)
用户sa的登录失败
检查服务器中是否存在具有正确权限的用户,并检查您正在使用的密码。