Processing on MySQL query taking too long and throwing “Communications link failure”
问题 I issued a query using a JDBC connection: Connection conn = null Class.forName("com.mysql.jdbc.Driver") conn = DriverManager.getConnection(dbHost, dbUser, dbPass) s = conn.createStatement(java.sql.ResultSet.TYPE_FORWARD_ONLY, java.sql.ResultSet.CONCUR_READ_ONLY); s.setFetchSize(Integer.MIN_VALUE); r = s.executeQuery (MY_SELECT_QUERY); while(...) { processResultSet(r); } The while runs for a long time processing the ResultSet. After around 1 hour i got the exception: com.mysql.jdbc.exceptions