diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/core/JdbcOperations.java b/spring-jdbc/src/main/java/org/springframework/jdbc/core/JdbcOperations.java
index 69aa01f6945..b837b03f51c 100644
--- a/spring-jdbc/src/main/java/org/springframework/jdbc/core/JdbcOperations.java
+++ b/spring-jdbc/src/main/java/org/springframework/jdbc/core/JdbcOperations.java
@@ -997,6 +997,29 @@ public interface JdbcOperations {
*/
int[] batchUpdate(String sql, BatchPreparedStatementSetter pss) throws DataAccessException;
+ /**
+ * Issue multiple update statements on a single PreparedStatement,
+ * using batch updates and a BatchPreparedStatementSetter to set values.
+ * Generated keys will be put into the given KeyHolder.
+ *
Note that the given PreparedStatementCreator has to create a statement
+ * with activated extraction of generated keys (a JDBC 3.0 feature). This can
+ * either be done directly or through using a PreparedStatementCreatorFactory.
+ *
Will fall back to separate updates on a single PreparedStatement
+ * if the JDBC driver does not support batch updates.
+ * @param psc a callback that creates a PreparedStatement given a Connection
+ * @param pss object to set parameters on the PreparedStatement
+ * created by this method
+ * @param generatedKeyHolder a KeyHolder that will hold the generated keys
+ * @return an array of the number of rows affected by each statement
+ * (may also contain special JDBC-defined negative values for affected rows such as
+ * {@link java.sql.Statement#SUCCESS_NO_INFO}/{@link java.sql.Statement#EXECUTE_FAILED})
+ * @throws DataAccessException if there is any problem issuing the update
+ * @since 6.1
+ * @see org.springframework.jdbc.support.GeneratedKeyHolder
+ */
+ int[] batchUpdate(PreparedStatementCreator psc, BatchPreparedStatementSetter pss,
+ KeyHolder generatedKeyHolder) throws DataAccessException;
+
/**
* Execute a batch using the supplied SQL statement with the batch of supplied arguments.
* @param sql the SQL statement to execute
diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/core/JdbcTemplate.java b/spring-jdbc/src/main/java/org/springframework/jdbc/core/JdbcTemplate.java
index 37b5996db30..79a075307f3 100644
--- a/spring-jdbc/src/main/java/org/springframework/jdbc/core/JdbcTemplate.java
+++ b/spring-jdbc/src/main/java/org/springframework/jdbc/core/JdbcTemplate.java
@@ -996,21 +996,10 @@ public class JdbcTemplate extends JdbcAccessor implements JdbcOperations {
return updateCount(execute(psc, ps -> {
int rows = ps.executeUpdate();
- List