druid SqlServer driver validateConnection false

jxct1oxe  于 2021-11-27  发布在  Java
关注(0)|答案(2)|浏览(544)

mssql-jdbc version: 9.2.1.jre8
druid version: 1.2.6

2021-09-13 16:01:24,849 ERROR com.alibaba.druid.pool.DruidDataSource [] - create connection SQLException, url: jdbc:sqlserver://172.16.101.246:1433;DatabaseName=db_test, errorCode 0, state null
java.sql.SQLException: validateConnection false
at com.alibaba.druid.pool.DruidAbstractDataSource.validateConnection(DruidAbstractDataSource.java:1418) ~[flinkx-connector-sqlserver-1.12_test_4.3.x.jar:?]
at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1733) ~[flinkx-connector-sqlserver-1.12_test_4.3.x.jar:?]
at com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:2801) [flinkx-connector-sqlserver-1.12_test_4.3.x.jar:?]
Caused by: java.lang.NullPointerException
at com.microsoft.sqlserver.jdbc.SQLServerStatement.ensureSQLSyntax(SQLServerStatement.java:778) ~[flinkx-connector-sqlserver-1.12_test_4.3.x.jar:?]
at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteStatement(SQLServerStatement.java:822) ~[flinkx-connector-sqlserver-1.12_test_4.3.x.jar:?]
at com.microsoft.sqlserver.jdbc.SQLServerStatement$StmtExecCmd.doExecute(SQLServerStatement.java:767) ~[flinkx-connector-sqlserver-1.12_test_4.3.x.jar:?]
at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7418) ~[flinkx-connector-sqlserver-1.12_test_4.3.x.jar:?]
at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:3272) ~[flinkx-connector-sqlserver-1.12_test_4.3.x.jar:?]
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:247) ~[flinkx-connector-sqlserver-1.12_test_4.3.x.jar:?]
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:222) ~[flinkx-connector-sqlserver-1.12_test_4.3.x.jar:?]
at com.microsoft.sqlserver.jdbc.SQLServerStatement.execute(SQLServerStatement.java:743) ~[flinkx-connector-sqlserver-1.12_test_4.3.x.jar:?]
at com.alibaba.druid.pool.vendor.MSSQLValidConnectionChecker.isValidConnection(MSSQLValidConnectionChecker.java:50) ~[flinkx-connector-sqlserver-1.12_test_4.3.x.jar:?]
at com.alibaba.druid.pool.DruidAbstractDataSource.validateConnection(DruidAbstractDataSource.java:1398) ~[flinkx-connector-sqlserver-1.12_test_4.3.x.jar:?]
... 2 more

7gs2gvoe

7gs2gvoe1#

SQLServer确实有这个问题

2guxujil

2guxujil2#

今天也遇到了,druid版本换成 1.2.5 解决

相关问题