This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes Mysql support rollback or not Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Mysql support rollback or not" Watch "Mysql support rollback or not" New topic

Mysql support rollback or not

Syed Saifuddin
Ranch Hand

Joined: Sep 01, 2003
Posts: 130

I am using type 4 driver name ConnectorJ with file mysql-connector-java-3.1.0-alpha-bin.jar.

My code is
con = DriverManager.getConnection("jdbc:mysql://localhost/hrms?user=root");
System.out.println("commit = "+con.getAutoCommit());

After this I have 7 PreparedStatement and then a condition for commit or rollback but rollback doesn't work.

If any other driver works fine at your end please tell me the name of driver .


Thank You & Best Regards,

Syed Saifuddin,
Senior Software Engineer

SAP Oracle AIX & Java Training
Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336

This will depend more on whether the DB engine you are using supports transactions or not. The default in MySQL I think is ISAM (correct mme if I'm wrong) which doesn't support transactions, and you'll need InnoDB which does.

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
I agree. Here's the link:
subject: Mysql support rollback or not
It's not a secret anymore!