....
Connection con = null;
Statement st = null;
try{
Class.forName("oracle.jdbc.driver.OracleDriver");
con = DriverManager.getConnection("...","...","...");
//设置事物处理
con.setAutoCommit(false);
st = ct.createStatement();
st.executeUpdate("update...");
st.executeUpdate("update...");
con.commit();
}catch(Exception e){
con.rollback();
//回滚之后要不要再commit下?
e.printStackTrace();
}finally{
st.close();
con.close();
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货