wood burning stoves 2.0*
The moose likes JDBC and the fly likes rs.next executing extremely slow Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "rs.next executing extremely slow" Watch "rs.next executing extremely slow" New topic

rs.next executing extremely slow

steph rinert

Joined: Oct 31, 2002
Posts: 7
Help, I have a result set thats used in a while loop and when it reaches rs.next, it takes forever to execute. I have maybe 10 small rows within the RS--Why would this be happening? its goes throug the body of the while statment without any delay but once it reaches rsProcess.next , it dies for a good 15 to 20 sec. while it executes the .next
while (rsProcess.next()) {###take long time
for (int i = 1; i <= numColumns; ++i ) {switch( metaData.getColumnType(i)) {
case 2:
doubleTemp = rsProcess.getDouble(i);
if (rsProcessAscii.wasNull( )) {
doubleCol = null;..................
senthil nathan

Joined: Jun 14, 2002
Posts: 17
Within while(rs.next) you are doing costly operations like getMetaData.Also u r looping inside while rs.next which needs to go looping...try to separate the code and see u should be able to see it work faster.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: rs.next executing extremely slow
Similar Threads
How to convert Blob Type back to File
problem with db2driver
while loop doubt
jsp resultset
isLast method for result set is not working