Why Spring's jdbcTemplate.batchUpdate() so slow?
I'm trying to find the faster way to do batch insert . I tried to insert several batches with jdbcTemplate.update(String sql) , where sql was builded by StringBuilder and looks like: INSERT INTO TABLE(x, y, i) VALUES(1,2,3), (1,2,3), ... , (1,2,3) Batch size was exactly 1000. I inserted nearly 100 batches. I checked the time using StopWatch and found out insert time: min[38ms], avg[50ms], max[190ms] per batch I was glad but I wanted to make my code better. After that, I tried to use jdbcTemplate.batchUpdate in way like: jdbcTemplate.batchUpdate(sql, new BatchPreparedStatementSetter() {