This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes .commit() and .rollback() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark ".commit() and .rollback()" Watch ".commit() and .rollback()" New topic

.commit() and .rollback()

Justin Fox
Ranch Hand

Joined: Jan 24, 2006
Posts: 802
I understood that you use these to methods in a finally block,

but i thought that a finally block came after the try-catch statement.

and what is it that these two methods, commit() and rollback() do?



You down with OOP? Yeah you know me!
marc weber

Joined: Aug 31, 2004
Posts: 11343

Originally posted by Justin Fox:
...and what is it that these two methods, commit() and rollback() do? ...

See java.sql.Connection.

"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63202

Moved to the JDBC forum.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: .commit() and .rollback()
It's not a secret anymore!