This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Kinda Confused::Update ResultSet

 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Michael Zalewski
Ranch Hand
Posts: 168
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can't believe I am just now finding this out. That is going to save me a lot of work.
Thanks a bunch!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic