62,634
社区成员




long total = total + 1000000000l; //total=100W
String sql = "insert into student values(?,?,?,?,?)";
Connection conn = DButils.getConnection();
PreparedStatement st = null;
int t = 1;
conn.setAutoCommit(false);
st = conn.prepareStatement(sql);
for(long i=1000000001; i<= total; i++){
st.setLong(1, i);
st.setString(2, i+"");
st.setInt(3, 20);
st.setInt(4, i%2==0?0:1);
st.setDate(5, new Date(86,8,6));
st.addBatch();
if(t++%100000 == 0) { st.executeBatch(); t=1; }
}
st.executeBatch();
conn.commit();
if(t++%100000 == 0) {
st.executeBatch();
st.clearBatch();//这个忘记加了吧
t=1;
}
long total = total + 1000000000l; //total=100W
for(long i=1000000001; i<= total; i++){