我使用JDBC连接到MySQL服务器(我认为没有连接池).在我的连接URL中autoReconnect=true
但我的联系仍然超时.我甚至检查过conn.isClosed()它的错误.但是当我尝试使用连接时,我得到以下异常.
com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception: ** BEGIN NESTED EXCEPTION ** java.net.SocketException MESSAGE: Software caused connection abort: socket write error STACKTRACE: java.net.SocketException: Software caused connection abort: socket write error ...
我知道在Java 1.6中你可以conn.isValid(0)用来检查连接,但我使用的是Java 1.5
有没有办法确保它没有超时?或者我将不得不升级到Java 1.6?