天天看點

PreparedStatement批量處理的一個Framework(原創)

場景:

批量進行DML操作,但涉及的表不同,不能使用executeBatch()

需求:

(1)如果DML中有一個錯誤時,要全部復原;

(2)如果全部正确,要全部執行;

解決方案:

結果:

測試通過

Tips:

關于executeBatch參見http://www.cnblogs.com/softidea/p/4663090.html