skip to Main Content

when I using jdbc api to rollback sql, it doesnot work. i wonder where is this the problem?
here is the codes:

connection.setAutocommit(false);
statement.execute("create table xxx");
connection.rollback();

table xxx should be rollbacked.

2

Answers


  1. maybe you should user the method of connection.close()

    Login or Signup to reply.
  2. You can’t rollback the creation of a table. All DDL operation can’t be rollbacked

    You can check the doc statements that can not be rollbacked

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search