• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

rs.next executing extremely slow

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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;..................
.........................................
 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic