Failed to validate a newly established connection异常

1403 查看

异常

2016-08-04T07:49:39.261362554Z 2016-08-04 15:49:39 [http-nio-9099-exec-8] (ErrorController.java:24)  - Could not get JDBC Connection; nested exception is java.sql.SQLException: Failed to validate a newly established connection.
2016-08-04T07:49:39.261511456Z org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: Failed to validate a newly established connection.
2016-08-04T07:49:39.261527088Z     at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:80) ~[spring-jdbc-4.2.6.RELEASE.jar!/:4.2.6.RELEASE]
2016-08-04T07:49:39.261533756Z     at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:615) ~[spring-jdbc-4.2.6.RELEASE.jar!/:4.2.6.RELEASE]
2016-08-04T07:49:39.261538975Z     at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:680) ~[spring-jdbc-4.2.6.RELEASE.jar!/:4.2.6.RELEASE]
2016-08-04T07:49:39.261548819Z     at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:712) ~[spring-jdbc-4.2.6.RELEASE.jar!/:4.2.6.RELEASE]
2016-08-04T07:49:39.261557195Z     at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:722) ~[spring-jdbc-4.2.6.RELEASE.jar!/:4.2.6.RELEASE]
2016-08-04T07:49:39.261562324Z     at org.springframework.jdbc.core.JdbcTemplate.queryForObject(JdbcTemplate.java:790) ~[spring-jdbc-4.2.6.RELEASE.jar!/:4.2.6.RELEASE]
2016-08-04T07:49:39.261572838Z     at org.springframework.jdbc.core.JdbcTemplate.queryForObject(JdbcTemplate.java:814) ~[spring-jdbc-4.2.6.RELEASE.jar!/:4.2.6.RELEASE]

配置validationQuery

oracle


validationQuery=select 1 from dual

pg/mysql


validationQuery=select 1