Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a batchUpdate method to namedParameterJdbcTemplate [SPR-3322] #8007

Closed
spring-projects-issues opened this issue Mar 29, 2007 · 2 comments
Labels
in: data Issues in data modules (jdbc, orm, oxm, tx) type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Mar 29, 2007

Mark St. John opened SPR-3322 and commented

To add batch updating support to NamedParameterJdbcTemplate, the following method could be added to it:
public void batchUpdate(String sql, NamedParameterBatchPreparedStatementSetter npbpss) throws DataAccessException

NamedParameterBatchPreparedStatementSetter would be a new Interface that behaves like BatchPreparedStatement except that its setValues method would look like the following:
public void setValues(PreparedStatement ps, Map<String, Object[]> paramMap)

paramMap would contain the parameter name as the key, and an array of objects to substitute as the value


Issue Links:

Referenced from: commits 4105957, 0d5c9c1, f4e75de

1 votes, 2 watchers

@spring-projects-issues
Copy link
Collaborator Author

Toshifumi Kato commented

I agree.
It would be great to have batchUpdate added to NamedParameterJdbcTemplate.

@spring-projects-issues
Copy link
Collaborator Author

Thomas Risberg commented

I added two batchUpdate methods - one takes an array of Maps containing the batch parameter values; the other one takes an array of SqlParameterSource objects for the batch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: data Issues in data modules (jdbc, orm, oxm, tx) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

1 participant