....
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();
}