// 加载数据驱动
Class.forName("oracle.jdbc.driver.OracleDriver");
// 获取连接
conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:iasdb","borough_user","password");
conn.setAutoCommit(false);// 取消自动事务提交
String sql1 = " update approved_maininfo t set t.declareflag='N' where 1=1  and t.seqcode in (?) ";
ps = conn.prepareStatement(sql1);
ps.setString(1, a);其中a是由500个主键拼接而成,如1,2,3,4,……500
ps.addBatch();
//类似以上操作 ps.accBatch();执行该操作7次
ps.executeBatch();// 执行批try {// 这里一定要捕捉异常
conn.commit();// 提交事务
} catch (SQLException exc) {
conn.rollback();// 在批处理命令中,如果有一个命令出现了错误,则回滚
}
执行该操作,用的时间特长,请问哪位能给优化一下