im trying to iterate through a large database (over 5000 entries), and printing out the entries
using this code:
[code=java]
String sql = "SELECT "+column+ " ,clickurl from " + tableName;
stmt = conn.prepareSta tement(sql);
ResultSet results=stmt.ex ecuteQuery();
while(results.n ext()){
String clickurl = results.getStri ng(2);
System.out.prin tln(" Test - " + clickurl);
}
[/code]
but after the 4000. entry java runs out of memory.
i dont know if i understand the system correctly, but the results are stored in the a ResultSet variable already, and iterating through it shouldn't require more memory.
i can't figure out what the problem is.
using this code:
[code=java]
String sql = "SELECT "+column+ " ,clickurl from " + tableName;
stmt = conn.prepareSta tement(sql);
ResultSet results=stmt.ex ecuteQuery();
while(results.n ext()){
String clickurl = results.getStri ng(2);
System.out.prin tln(" Test - " + clickurl);
}
[/code]
but after the 4000. entry java runs out of memory.
i dont know if i understand the system correctly, but the results are stored in the a ResultSet variable already, and iterating through it shouldn't require more memory.
i can't figure out what the problem is.
Comment