druid连接数据库时候报严重: testWhileIdle is true, validationQuery not set

八月 26, 2020 12:43:43 下午 com.alibaba.druid.pool.DruidDataSource error
严重: testWhileIdle is true, validationQuery not set
八月 26, 2020 12:43:43 下午 com.alibaba.druid.pool.DruidDataSource info
信息: {
    
    dataSource-1} inited

使用druid连接数据库时候,造成的原因是druid.properties参数配置问题,应该加上:

validationQuery:SELECT 1
testWhileIdle:true
testOnBorrow:false
testOnReturn:false

猜你喜欢

转载自blog.csdn.net/zhanlong11/article/details/108237700