批量插入注意事項:
新建Connection時加一句
conn.setAutoCommit(false);
每行數據賦值完,加一句
stat.addBatch();
最後
stat.executeBatch(); conn.commit();
最後記得free釋放資源
批量插入注意事項:
新建Connection時加一句
conn.setAutoCommit(false);
每行數據賦值完,加一句
stat.addBatch();
最後
stat.executeBatch(); conn.commit();
最後記得free釋放資源