This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Kinda Confused::Update ResultSet

 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • 0
  • 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
  • 0
  • 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
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • 0
  • 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!
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic