created a protected doSetValue method so sub-classes can override the implementation easier (SPR-3978)
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@2416 50f2f4bb-b051-0410-bef5-90022cba6387
This commit is contained in:
parent
bc3184a5dd
commit
62fa0a39af
|
|
@ -43,7 +43,7 @@ class ArgPreparedStatementSetter implements PreparedStatementSetter, ParameterDi
|
||||||
if (this.args != null) {
|
if (this.args != null) {
|
||||||
for (int i = 0; i < this.args.length; i++) {
|
for (int i = 0; i < this.args.length; i++) {
|
||||||
Object arg = this.args[i];
|
Object arg = this.args[i];
|
||||||
doSetValue(ps, i, arg);
|
doSetValue(ps, i + 1, arg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -59,10 +59,10 @@ class ArgPreparedStatementSetter implements PreparedStatementSetter, ParameterDi
|
||||||
protected void doSetValue(PreparedStatement ps, int parameterPosition, Object argValue) throws SQLException {
|
protected void doSetValue(PreparedStatement ps, int parameterPosition, Object argValue) throws SQLException {
|
||||||
if (argValue instanceof SqlParameterValue) {
|
if (argValue instanceof SqlParameterValue) {
|
||||||
SqlParameterValue paramValue = (SqlParameterValue) argValue;
|
SqlParameterValue paramValue = (SqlParameterValue) argValue;
|
||||||
StatementCreatorUtils.setParameterValue(ps, parameterPosition + 1, paramValue, paramValue.getValue());
|
StatementCreatorUtils.setParameterValue(ps, parameterPosition, paramValue, paramValue.getValue());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
StatementCreatorUtils.setParameterValue(ps, parameterPosition + 1, SqlTypeValue.TYPE_UNKNOWN, argValue);
|
StatementCreatorUtils.setParameterValue(ps, parameterPosition, SqlTypeValue.TYPE_UNKNOWN, argValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue