我计划在清除某些数据时禁用外键约束以避免递归关系。主要步骤写如下:
Connection conn = getConnection(SI_SINGLE_URL2, SI_UNAME2, SI_PASS2); // will return a valid java,sql.Connection
Statement stmt = conn.createStatement();
boolean isConstraintDisabled = stmt.execute("ALTER TABLE zee_temp_tab_2 NOCHECK CONSTRAINT ALL");
stmt.executeQuery("DELETE FROM zee_temp_tab_2 WHERE id = 'A'");
boolean isConstraintEnabled = stmt.execute("ALTER TABLE zee_temp_tab_2 CHECK CONSTRAINT ALL");
请告知如何做。