• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Mysql support rollback or not

 
Syed Saifuddin
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic