MySQL+DBCPでDB接続するときは、DB接続タイムアウト時の対策として検証クエリを入れましょうというお話。 現象 MySQLのサーバパラメータ "wait_timeout" の秒数(デフォルト:28800秒 = 8時間) を超過してDBに再接続しようとすると以下の例外が発生した。 org.springframework.security.AuthenticationServiceException: PreparedStatementCallback; SQL [SELECT user_id, password, role_id FROM user WHERE user_id = ?]; The last packet successfully received from the server was 54,586,800 milliseconds ago. The last pac