Polishing
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -933,6 +933,7 @@ public interface JdbcOperations {
|
||||
* @param pss ParameterizedPreparedStatementSetter to use
|
||||
* @return an array containing for each batch another array containing the numbers of rows affected
|
||||
* by each update in the batch
|
||||
* @since 3.1
|
||||
*/
|
||||
<T> int[][] batchUpdate(String sql, Collection<T> batchArgs, int batchSize,
|
||||
ParameterizedPreparedStatementSetter<T> pss) throws DataAccessException;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -984,11 +984,7 @@ public class JdbcTemplate extends JdbcAccessor implements JdbcOperations {
|
||||
int[][] result = execute(sql, (PreparedStatementCallback<int[][]>) ps -> {
|
||||
List<int[]> rowsAffected = new ArrayList<>();
|
||||
try {
|
||||
boolean batchSupported = true;
|
||||
if (!JdbcUtils.supportsBatchUpdates(ps.getConnection())) {
|
||||
batchSupported = false;
|
||||
logger.warn("JDBC Driver does not support Batch updates; resorting to single statement execution");
|
||||
}
|
||||
boolean batchSupported = JdbcUtils.supportsBatchUpdates(ps.getConnection());
|
||||
int n = 0;
|
||||
for (T obj : batchArgs) {
|
||||
pss.setValues(ps, obj);
|
||||
|
||||
Reference in New Issue
Block a user