Deprecate multi-batch batchUpdate variant in JdbcTemplate

Closes gh-37345
This commit is contained in:
Juergen Hoeller
2026-09-30 22:29:57 +02:00
parent 5e7630469c
commit 141a84724a
3 changed files with 7 additions and 1 deletions
@@ -1042,7 +1042,10 @@ public interface JdbcOperations {
* {@link java.sql.Statement#SUCCESS_NO_INFO}/{@link java.sql.Statement#EXECUTE_FAILED})
* @throws DataAccessException if there is any problem issuing the update
* @since 3.1
* @deprecated as of 7.1, in favor of single batchUpdate calls which execute the
* entire batch (since modern databases do not restrict the batch size anymore)
*/
@Deprecated(since = "7.1")
<T> int[][] batchUpdate(String sql, Collection<T> batchArgs, int batchSize,
ParameterizedPreparedStatementSetter<T> pss) throws DataAccessException;
@@ -1087,6 +1087,7 @@ public class JdbcTemplate extends JdbcAccessor implements JdbcOperations {
});
}
@Deprecated(since = "7.1")
@Override
public <T> int[][] batchUpdate(String sql, Collection<T> batchArgs, int batchSize,
ParameterizedPreparedStatementSetter<T> pss) throws DataAccessException {
@@ -36,8 +36,10 @@ import java.sql.SQLException;
* @author Thomas Risberg
* @since 3.1
* @param <T> the argument type
* @see JdbcTemplate#batchUpdate(String, java.util.Collection, int, ParameterizedPreparedStatementSetter)
* @deprecated as of 7.1, along with
* {@link JdbcTemplate#batchUpdate(String, java.util.Collection, int, ParameterizedPreparedStatementSetter)}
*/
@Deprecated(since = "7.1")
@FunctionalInterface
public interface ParameterizedPreparedStatementSetter<T> {