commit()
Connection conn = …… //省略部分程式碼 conn.setAutoCommit(false); //先將事務設為手動提交 Statement st = conn.createStatement(); String sql = "INSERT INTO users VALUES('xiaoli','123456')"; st.execute(sql); conn.commit(); //提交事務