要设置一下idleConnectionTestPeriod参数,值比过期时间小,这样定时检查数据库连接情况就不会再报错了。
详见http://www.msjava.com/share/27/item.html