From 3faf28ebaf73c1067edadcbc3d1974c25dfca80a Mon Sep 17 00:00:00 2001 From: Thomas Risberg Date: Thu, 12 Nov 2009 20:51:00 +0000 Subject: [PATCH] created a protected doSetValue method so sub-classes can override the implementation easier (SPR-3978) --- .../jdbc/core/ArgPreparedStatementSetter.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/org.springframework.jdbc/src/main/java/org/springframework/jdbc/core/ArgPreparedStatementSetter.java b/org.springframework.jdbc/src/main/java/org/springframework/jdbc/core/ArgPreparedStatementSetter.java index 3f84a17e5ad..19b5ec0d49b 100644 --- a/org.springframework.jdbc/src/main/java/org/springframework/jdbc/core/ArgPreparedStatementSetter.java +++ b/org.springframework.jdbc/src/main/java/org/springframework/jdbc/core/ArgPreparedStatementSetter.java @@ -43,7 +43,7 @@ class ArgPreparedStatementSetter implements PreparedStatementSetter, ParameterDi if (this.args != null) { for (int i = 0; i < this.args.length; 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 { if (argValue instanceof SqlParameterValue) { SqlParameterValue paramValue = (SqlParameterValue) argValue; - StatementCreatorUtils.setParameterValue(ps, parameterPosition + 1, paramValue, paramValue.getValue()); + StatementCreatorUtils.setParameterValue(ps, parameterPosition, paramValue, paramValue.getValue()); } else { - StatementCreatorUtils.setParameterValue(ps, parameterPosition + 1, SqlTypeValue.TYPE_UNKNOWN, argValue); + StatementCreatorUtils.setParameterValue(ps, parameterPosition, SqlTypeValue.TYPE_UNKNOWN, argValue); } }