aspose file tools*
The moose likes JDBC and the fly likes Kinda Confused::Update ResultSet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Kinda Confused::Update ResultSet" Watch "Kinda Confused::Update ResultSet" New topic
Author

Kinda Confused::Update ResultSet

Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15300
    
    6

If I make a ResultSet Updatable, and then make changes to the ResultSet, does that actually change the database as well or do I still have to update the database?
I didn't know if a ResultSet was just a cached dataset from the database or if it was still connected.
Thanks.


GenRocket - Experts at Building Test Data
Michael Zalewski
Ranch Hand

Joined: Apr 23, 2002
Posts: 168
A ResultSet is still connected to the database.
To update an updatable ResultSet, you would have to call ResultSet.updateRow() after you made the changes.
When you call methods like ResultSet.updateString( int, String), nothing happens to the database (except maybe locking the row, depending on the ResultSet cursor parameters and the database driver).
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15300
    
    6

I can't believe I am just now finding this out. That is going to save me a lot of work.
Thanks a bunch!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Kinda Confused::Update ResultSet