• 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

What hapens internally when i execute rs.next() or when I receive multiple resultsets?

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As per the info. i got from Net,

It depends on the driver implementation. It may go back to database and fetch the next row.
Or all data may come and sit inside the Java memory as objects and can be served.

I have questions on these too... If we go back and forth again and again, it is costly and time consuming operation.
On the otherhand, i twe kepp inside the memory, it may consume all memory and no space for the remaining objects.
In production, there might be chances that because of above reason, we may get lot of 'OutOfMemoryException', is not it?

How doe sit handles in realty. We are using DB2 type 2 driver.
When I try to move across result sets, what happens then?

Please share your thoughts.
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It depends on the driver. Most databases will fetch a certain number of rows (which you can change) at a time and keep those in memory. Then they will go to the database to get the next group.
 
reply
    Bookmark Topic Watch Topic
  • New Topic