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.
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
maybe you should user the method of connection.close()
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