I am using spring. I have many update steps, Is there a way to used batchUpdate for this?
Original
jdbcTemplate.update("UPDATE USER SET name = ? WHERE user_id = ?", new Object[] {name, id});
jdbcTemplate.update("UPDATE USER2 SET name = ? WHERE user_id = ?", new Object[] {name, id2});
jdbcTemplate.update("UPDATE USER3 SET name = ? WHERE user_id = ?", new Object[] {name, id3});
How to used batchUpdate
getJdbcTemplate().batchUpdate(sql);
Because the parameter for batchUpdate is Array[]. How to convert the prepare statement SQL string with an Object to the exact SQL string?