jdbc addbatch

jdbc addBatch方法:

 

Statememt stmt=conn.createStatement();
stmt.addBatch("insert into .....");
stmt.addBatch("insert into .....");
stmt.addBatch("insert into .....");
stmt.executeBatch();
stmt.close();
PreparedStatement ps=conn.prepareStatement("insert Into biao values(?,?)");
ps.setInt(1,61);
ps.setInt(2,61);
ps.addBatch();
ps.setInt(1,61);
ps.setInt(2,61);
ps.addBatch();  
ps.executeBatch();
ps.close();

你可能感兴趣的:(jdbc)