錯誤出現:
含有錯誤的查詢后,選中insert語句無法執行,報錯current transaction is aborted, commands ignored until end of transaction block
分析:
事務中含有錯誤,再執行DML時,事務無法正常進行。
解決方法:
1.嘗試connection.setAutoCommit(true);無法執行
2.直接commit ,提交后再執行insert語句,成功插入。
參考了stackoverflow的解法: