我更改了代码,此代码插入 30 000 row/min ,但它太慢了。我的任何人都给我另一个想法如何提高速度?
Connection connection = poolledConnection.getConnection();
connection.setAutoCommit(false);
int bathcount = 0;
Statement st = connection.createStatement();
for (condit){
st.addBatch(sql);
if (bathcount >= 10000){
st.executeBatch();
connection.commit();
st.clearBatch();
bathcount = 0;
}
bathcount++;
}
}