public boolean execute() {
//Adapter.DB cc=null;
Connection conn=null;
Statement stmt = null;
try{
//cc = Adapter.DB.binding("ff6aa24f543043311ca87789ab71619b");
conn = DBSql.open();
conn.setAutoCommit(false);//取消自动提交
stmt=conn.createStatement();
//执行insert或update语句
stmt.addBatch("update BO_TEST set score=10 where id=13324642");
stmt.addBatch("update BO_TEST set score=12 where id=13324643");
stmt.addBatch("update BO_TEST set score='一百' where id=13359038");
stmt.executeBatch();
conn.commit();
}catch(Exception e){
try {
conn.rollback();
} catch (SQLException e1) {
e1.printStackTrace();
}
e.printStackTrace();
}finally{
//Adapter.DB.close(conn, stmt, null);
DBSql.close(conn, stmt, null);
}
return false;
}
java与oracle事务的结合
最新推荐文章于 2023-04-03 10:36:50 发布