修改外键约束

This commit is contained in:
cyk
2023-07-10 12:02:57 +08:00
parent 76f4602bca
commit f606f80584

View File

@@ -369,8 +369,10 @@ public class projectDao {
try {
Connection conn = JdbcUtils.getConnection();
QueryRunner runner = new QueryRunner();
runner.update(conn,"set foreign_key_checks = 0");
String sql="delete from project where projectId = ?";
num = runner.update(conn,sql,id);
runner.update(conn,"set foreign_key_checks = 1");
} catch (SQLException e) {
throw new RuntimeException(e);
}