Java Code Examples for org.springframework.jdbc.core.BatchUpdateUtils

The following examples show how to use org.springframework.jdbc.core.BatchUpdateUtils. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
public void queryBatchUpdateUnsafe(String input) {
    String sql = "UPDATE Users SET name = '"+input+"' where id = 1";
    BatchUpdateUtils.executeBatchUpdate(sql, new ArrayList<Object[]>(),new int[] {Types.INTEGER}, jdbcOperations);
}
 
Example 2
public void queryBatchUpdateSafe() {
    String sql = "UPDATE Users SET name = 'safe' where id = 1";
    BatchUpdateUtils.executeBatchUpdate(sql, new ArrayList<Object[]>(),new int[] {Types.INTEGER}, jdbcOperations);
}
 
Example 3
Source Project: effectivejava   Source File: SimpleJdbcTemplate.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public int[] batchUpdate(String sql, List<Object[]> batchArgs, int[] argTypes) {
	return BatchUpdateUtils.executeBatchUpdate(sql, batchArgs, argTypes, getJdbcOperations());
}