使用JDBC API回滚事务失败。

huangapple go评论70阅读模式
英文:

using jdbc api to rollback transcation fail

问题

当我使用 JDBC API 来回滚 SQL 时,它不起作用。我想知道问题出在哪里?
以下是代码:

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

表 xxx 应该被回滚。

英文:

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.

答案1

得分: 1

你无法回滚表的创建。所有 DDL 操作 都无法回滚。

你可以查看文档中的 无法回滚的语句

英文:

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

huangapple
  • 本文由 发表于 2023年6月26日 11:23:43
  • 转载请务必保留本文链接:https://go.coder-hub.com/76553347.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定