JDBC connection hangs at executing rs.next()
Posted by: Marc Juarez
Date: May 16, 2012 04:55AM

Hi to everyone,

I'm trying to read from a mySQL server (in my LAN) a huge resultSet. I implemented it the way I found looking for the setFetchSize method. So I did:

con = DriverManager.getConnection(url, user, password);

//con.setAutoCommit(false);
st = con.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
st.setFetchSize(Integer.MIN_VALUE);
rs = st.executeQuery(query);

int count = 0;
while (rs.next ()) {
// Process entry
String rsc = rs.getString ("resource");
String tpc = rs.getString("topic");
System.out.println(count + ": " + rsc);
++count;
}




I'm trying to read from a mySQL server (in my LAN) a huge resultSet. I implemented it the way I found looking for the setFetchSize method: BalusC's Example. So I did:

con = DriverManager.getConnection(url, user, password);

//con.setAutoCommit(false);
st = con.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
st.setFetchSize(Integer.MIN_VALUE);
rs = st.executeQuery(query);

int count = 0;
while (rs.next ()) {
// Process entry
String rsc = rs.getString ("resource");
String tpc = rs.getString("topic");
System.out.println(count + ": " + rsc);
++count;
}


Although, it hangs at row 1077 at the line rs.next(). It doesn't throw exception.

EDIT: After a timeout something new happened. It returned this error message:

JDWP exit error JVMTI_ERROR_NONE(0): getting frame location [../../../src/share/back/stepControl.c:641]

Options: ReplyQuote


Subject
Written By
Posted
JDBC connection hangs at executing rs.next()
May 16, 2012 04:55AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.