aspose file tools*
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
JavaRanch » Java Forums » Databases » JDBC
Bookmark "rs.next executing extremely slow" Watch "rs.next executing extremely slow" New topic
Author

rs.next executing extremely slow

steph rinert
Greenhorn

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
Greenhorn

Joined: Jun 14, 2002
Posts: 17
Hi,
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.
ALL THE BEST.
Senthil
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: rs.next executing extremely slow