首页 > 解决方案 > JBOSS EAP 7 无法连接到 sql 2016 服务器上的数据库

问题描述

我正在开发一个升级项目,其中 SQL 服务器正在更新到 msssql 2016。我正在使用 mssql-jdbc-6.4.0.jre8.jar 和 java 8u121。使用相同的驱动程序应用程序能够与 sql 2012 服务器上的数据库建立连接。但失败并显示无法建立与数据库的连接的错误。

下面的堆栈跟踪。

18:33:12,325 DEBUG AbstractTransactionImpl:160 - begin
18:33:12,325 DEBUG LogicalConnectionImpl:226 - Obtaining JDBC connection
18:33:12,325 DEBUG SQLServerDriver:294 - Property:serverName Value:SQL-2016-server
18:33:12,325 DEBUG SQLServerDriver:320 - Property:portNumber Value:1433
18:33:12,325 DEBUG SQLServerDriver:396 - Property:databaseName Value:Test_Database
18:33:12,325 DEBUG SQLServerDriver:399 - Property:password
18:33:12,325 DEBUG SQLServerDriver:507 - Property:instanceName Value:Architecture
18:33:12,326 DEBUG SQLServerConnection:920 - ConnectionID:2 created by (SQLServerDriver:1)
18:33:12,326 DEBUG SQLServerConnection:1910 - ConnectionID:2 This attempt server name: SQL-2016-server port: 1433 InstanceName: Architecture useParallel: false
18:33:12,326 DEBUG SQLServerConnection:1913 - ConnectionID:2 This attempt endtime: 1541682194201
18:33:12,326 DEBUG SQLServerConnection:1914 - ConnectionID:2 This attempt No: 0
18:33:12,326 DEBUG SQLServerConnection:2228 - ConnectionID:2 Connecting with server: SQL-2016-server port: 1433 Timeout slice: 1875 Timeout Full: 15
18:33:12,326 DEBUG AbstractTransactionImpl:160 - begin
18:33:12,326 DEBUG LogicalConnectionImpl:226 - Obtaining JDBC connection
18:33:12,326 DEBUG SQLServerConnection:2547 - ConnectionID:2 ClientConnectionId: 887cb0e6-c7f7-4467-b1e3-ce1ccaeb5057 Server returned major version:13
18:33:12,326 DEBUG SQLServerDriver:294 - Property:serverName Value:SQL-2016-server
18:33:12,326 DEBUG SQLServerDriver:320 - Property:portNumber Value:1433
18:33:12,326 DEBUG SQLServerDriver:396 - Property:databaseName Value: Test_Database
18:33:12,326 DEBUG SQLServerDriver:399 - Property:password
18:33:12,326 DEBUG SQLServerDriver:507 - Property:instanceName Value:Architecture
18:33:12,326 DEBUG SQLServerConnection:920 - ConnectionID:3 created by (SQLServerDriver:1)
18:33:12,358 DEBUG SQLServerConnection:1910 - ConnectionID:3 This attempt server name: SQL-2016-server port: 1433 InstanceName: Architecture useParallel: false
18:33:12,358 DEBUG SQLServerConnection:1913 - ConnectionID:3 This attempt endtime: 1541682194233
18:33:12,358 DEBUG SQLServerConnection:1914 - ConnectionID:3 This attempt No: 0
18:33:12,358 DEBUG SQLServerConnection:2228 - ConnectionID:3 Connecting with server: Test_Database port: 1433 Timeout slice: 1875 Timeout Full: 15
18:33:12,358 DEBUG SQLServerException:102 - *** SQLException: com.microsoft.sqlserver.jdbc.SQLServerException: Login failed for user 'dbuser'. ClientConnectionId:xxx Msg 18456, Level 14, State 1, Login failed for user 'dbuser'. ClientConnectionId:887cb0e6-c7f7-4467-b1e3-ce1ccaeb5057
18:33:12,358 DEBUG SqlExceptionHelper:139 - Could not open connection [n/a]

官方 jboss 文档没有确认天气 SQL 2016 可以与 JBOSS EAP - 7 一起使用,它只是提到它未经测试。

我可以使用 Management Studio 中的相同用户帐户登录到所述数据库。

任何帮助将不胜感激。

提前致谢

标签: sql-server-2016hibernate-4.xmssql-jdbcjboss-eap-7

解决方案


推荐阅读