异常

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

codecraft
11.9k 声望2k 粉丝

当一个代码的工匠回首往事时,不因虚度年华而悔恨,也不因碌碌无为而羞愧,这样,当他老的时候,可以很自豪告诉世人,我曾经将代码注入生命去打造互联网的浪潮之巅,那是个很疯狂的时代,我在一波波的浪潮上留下...