wood burning stoves*
The moose likes JDBC and the fly likes resultset data stored in database or java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "resultset data stored in database or java" Watch "resultset data stored in database or java" New topic
Author

resultset data stored in database or java

amit sharma
Ranch Hand

Joined: Jul 19, 2006
Posts: 129
When i get a resultset by executing a query is the data stored in java or i database and resultset has only pointer to that records in database.
Thanks
Abhishek Asthana
Ranch Hand

Joined: Sep 08, 2004
Posts: 146
When you execute a query, using any of the statement.executeXXX (executeUpdate, executeQuery or execute) methods, the query is executed on the database and results wrapped and returned in ResultSet object by the driver.
Once you have got a handle to this ResultSet object, you can do whatever you want with the values contained by it. It is not going to affect the database values in any manner.
amit sharma
Ranch Hand

Joined: Jul 19, 2006
Posts: 129
Originally posted by Abhishek Asthana:
When you execute a query, using any of the statement.executeXXX (executeUpdate, executeQuery or execute) methods, the query is executed on the database and results wrapped and returned in ResultSet object by the driver.
Once you have got a handle to this ResultSet object, you can do whatever you want with the values contained by it. It is not going to affect the database values in any manner.

Let i close the connection then i try rs.next() it gives error
resultset closed.If all results are wrapped and in java then why we can't iterate through resultset.
thanks
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
I think all JDBC result sets are lazy loading, meaning they may not fetch all rows across the wire from the database into your memory until you scroll to a point where they're needed. That may force the database to hold some of your results in memory until you load to the end or close the resultset. I've never heard any concern about that being a problem on the db server.

And once you move past a row the resultset can throw it away, unless you've specified bidirectional scrolling.


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: resultset data stored in database or java
 
Similar Threads
supported content types in jsp
How to retrieve Date from JDBC using sql
Help-How to retrive binary object
Stored Procedure Problem
cs.executeQuery() throws "Query returned no data" error