我不知道如果我理解正確的概念,JDBC自動提交和回滾
如果我有:
try{
conn.setAutoCommit(false);
Statement st= conn.createStatement();
// valid statement
String statement1 = ....;
st.executeUpdate(statement1)
// invalid statement that will cause an error
String statement2 = ....;
st.executeUpdate(statement2)
}catch(SQLException e){
// there was an error
conn.rollback();
都聲明拋棄?還是它只會忽略statement2和statement1?
當您的問題是關於正常事務回滾(禁用自動提交)時,爲什麼您的標題爲「JDBC AutoCommit and Rollback」? –