• Post Reply Bookmark Topic Watch Topic
  • New Topic

Is there a begintrans in Java?  RSS feed

 
Sarah Gaikwad
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would like information on begintrans,is it the same as autocommit.

thanks
Sharun
 
Blake Minghelli
Ranch Hand
Posts: 331
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A bartender should probably move this to the JDBC forum.
But to answer your question, yes, you should use the setAutoCommit(true) method of your java.sql.Connection object if you want to explicitly use transactions.
When you set auto commit to true, then the JDBC driver is responsible for autmatically starting a transaction the next time you execute a statement. Then each time you do a commit() on the Connection object, the changes will be committed. Then the next statement you execute will start another transaction automatically and the cycle starts over again.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!