org.springframework.jdbc.core.BatchUpdateUtils Java Examples

The following examples show how to use org.springframework.jdbc.core.BatchUpdateUtils. 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
Source File: SpringBatchUpdateUtils.java    From Android_Code_Arbiter with GNU Lesser General Public License v3.0 4 votes vote down vote up
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
Source File: SpringBatchUpdateUtils.java    From Android_Code_Arbiter with GNU Lesser General Public License v3.0 4 votes vote down vote up
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 File: SimpleJdbcTemplate.java    From effectivejava with 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());
}