1

コードを変更したところ、このコードは 30 000 行/分を挿入しましたが、遅すぎます。速度を改善する方法を教えてください。

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++; 
    } 
}
4

1 に答える 1