Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Subhani Sk
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • 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.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34401
346
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic