Are you using a streaming connection? -----Original Message----- From: Leonardo Francalanci To: Mysql Sent: 6/22/04 7:43 AM Subject: connectorJ & huge table problem
I have a large table (64,000,000 rows). Everything was fine when the table was 16,000,000 rows, now connectorJ crashes: java.sql.SQLException: java.lang.ArrayIndexOutOfBoundsException: 6 at com.mysql.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedSta teme nt.java:908) at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:162 2) my code is: java.sql.Connection regularConn = ConnectionHandler.getRegularConnection(); java.sql.PreparedStatement ps1 = null; //letspartyConn.prepareStatement(query); for (int i = 0; i < 1000; i++) { String query = "SELECT * FROM PARTITIONED_B WHERE ID=?"; ps1 = regularConn.prepareStatement(query); int m = new Double(Math.random() * 64000000).intValue(); ps1.setInt(1, 12352597); ResultSet rs = ps1.executeQuery(); while (rs.next()) { int g = rs.getInt(2); } rs.close(); ps1.close(); } regularConn.close(); I debugged the code, and it seems to happen when it reads a long (readLongLong), but I don't have any data in my db that is long (everything is int, and in fact every time the method readLongLong gets called it crashes). The error seems very random (sometimes happens, some others no, and always with different IDs), I have no idea. Note that using the prepared statement in the proper way, that is: String query = "SELECT * FROM PARTITIONED_B WHERE ID=?"; ps1 = regularConn.prepareStatement(query); for (int i = 0; i < 1000; i++) { int m = new Double(Math.random() * 64000000).intValue(); ps1.setInt(1, 12352597); ResultSet rs = ps1.executeQuery(); while (rs.next()) { int g = rs.getInt(2); } rs.close(); } ps1.close(); regularConn.close(); everything works fine. Re-creating the PreparedStatement each time gives me the error above when I call ResultSet rs = ps1.executeQuery(). I'm using connectorJ 3.1.2, mysql 4.1.2 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]