Win a copy of Spring Boot in Practice this week in the Spring forum!
  • 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
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic