首页 > IT职业 > IT图书 > oracle数据库批处理演示
package cabby;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
/**
* 批处理演示
* @author Cabby
*
*/
public class BatchDemo {
public static void main(String[] args) {
batchSql();
}
public static void batchSql(){
String sql="insert into mytemp_xxx(id) values(?)";
Connection conn=null;
PreparedStatement stmt=null;
try {
conn=JDBCUtil.getConnection();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
try {
conn.setAutoCommit(false);
stmt=conn.prepareStatement(sql);
for(int i=1;i 来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/4586/viewspace-2798409/ ,如需转载,请注明出处,否则将追究法律责任。