| Author |
What hapens internally when i execute rs.next() or when I receive multiple resultsets?
|
Subhani Sk
Greenhorn
Joined: Oct 04, 2003
Posts: 5
|
|
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
internet detective
Marshal
Joined: May 26, 2003
Posts: 26201
|
|
|
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.
|
[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
|
 |
 |
|
|
subject: What hapens internally when i execute rs.next() or when I receive multiple resultsets?
|
|
|