标签:ddb 利用 dba manager hiberna throw set for insert
@org.junit.Test public void testBatch() { session.doWork(new Work() { @Override public void execute(Connection connection) throws SQLException { // TODO Auto-generated method stub String sql = "insert into manager (MGR_NAME) values (?)"; PreparedStatement pStatement = (PreparedStatement) connection.prepareStatement(sql); for(int i=0;i<10000;i++) { pStatement.setString(1,"xiaoyan"+i); pStatement.addBatch(); if(i%1000==0) { pStatement.executeBatch(); } } pStatement.executeBatch(); pStatement.close(); } }); }
标签:ddb 利用 dba manager hiberna throw set for insert
原文地址:http://www.cnblogs.com/lusufei/p/7351535.html