I'm using MySQL as my back-end. I get the following error when I try to execute any UPDATE or DELETE queries.
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Can't call rollback when autocommit=true
But, I've set the autocommit flag to false before calling rollback()
......
connectionUrl = "jdbc:mysql://localhost:3306/studentdb?"+"user=root&password=";
con = DriverManager.getConnection(connectionUrl);
if(con.getAutoCommit())
con.setAutoCommit(false);
......
......
con.rollback();
......
It would be of great help if you guys help me to solve this.
Thank you.