修改外键约束
This commit is contained in:
@@ -369,8 +369,10 @@ public class projectDao {
|
|||||||
try {
|
try {
|
||||||
Connection conn = JdbcUtils.getConnection();
|
Connection conn = JdbcUtils.getConnection();
|
||||||
QueryRunner runner = new QueryRunner();
|
QueryRunner runner = new QueryRunner();
|
||||||
|
runner.update(conn,"set foreign_key_checks = 0");
|
||||||
String sql="delete from project where projectId = ?";
|
String sql="delete from project where projectId = ?";
|
||||||
num = runner.update(conn,sql,id);
|
num = runner.update(conn,sql,id);
|
||||||
|
runner.update(conn,"set foreign_key_checks = 1");
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user