Skip to content

Commit 3faf28e

Browse files
author
Thomas Risberg
committedNov 12, 2009
created a protected doSetValue method so sub-classes can override the implementation easier (SPR-3978)
1 parent e27330e commit 3faf28e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎org.springframework.jdbc/src/main/java/org/springframework/jdbc/core/ArgPreparedStatementSetter.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public void setValues(PreparedStatement ps) throws SQLException {
4343
if (this.args != null) {
4444
for (int i = 0; i < this.args.length; i++) {
4545
Object arg = this.args[i];
46-
doSetValue(ps, i, arg);
46+
doSetValue(ps, i + 1, arg);
4747
}
4848
}
4949
}
@@ -59,10 +59,10 @@ public void setValues(PreparedStatement ps) throws SQLException {
5959
protected void doSetValue(PreparedStatement ps, int parameterPosition, Object argValue) throws SQLException {
6060
if (argValue instanceof SqlParameterValue) {
6161
SqlParameterValue paramValue = (SqlParameterValue) argValue;
62-
StatementCreatorUtils.setParameterValue(ps, parameterPosition + 1, paramValue, paramValue.getValue());
62+
StatementCreatorUtils.setParameterValue(ps, parameterPosition, paramValue, paramValue.getValue());
6363
}
6464
else {
65-
StatementCreatorUtils.setParameterValue(ps, parameterPosition + 1, SqlTypeValue.TYPE_UNKNOWN, argValue);
65+
StatementCreatorUtils.setParameterValue(ps, parameterPosition, SqlTypeValue.TYPE_UNKNOWN, argValue);
6666
}
6767
}
6868

0 commit comments

Comments
 (0)
Please sign in to comment.