File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC 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


JavaRanch » Java Forums » Databases » JDBC
Bookmark "Mysql support rollback or not" Watch "Mysql support rollback or not" New topic
Author

Mysql support rollback or not

Syed Saifuddin
Ranch Hand

Joined: Sep 01, 2003
Posts: 130
Hello

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

My code is
/********************************************/
Class.forName("com.mysql.jdbc.Driver");
con = DriverManager.getConnection("jdbc:mysql://localhost/hrms?user=root");
con.setAutoCommit(false);
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 .

Thankyou


Thank You & Best Regards,

Syed Saifuddin,
Senior Software Engineer

SAP Oracle AIX & Java Training
http://www.socialinet.com
Paul Sturrock
Bartender

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
 
GeeCON Prague 2014
 
subject: Mysql support rollback or not