@@ -53,7 +53,7 @@ public ArgTypePreparedStatementSetter(Object[] args, int[] argTypes) {
53
53
54
54
55
55
public void setValues (PreparedStatement ps ) throws SQLException {
56
- int argIndx = 1 ;
56
+ int parameterPosition = 1 ;
57
57
if (this .args != null ) {
58
58
for (int i = 0 ; i < this .args .length ; i ++) {
59
59
Object arg = this .args [i ];
@@ -65,21 +65,38 @@ public void setValues(PreparedStatement ps) throws SQLException {
65
65
Object [] valueArray = ((Object [])entry );
66
66
for (int k = 0 ; k < valueArray .length ; k ++) {
67
67
Object argValue = valueArray [k ];
68
- StatementCreatorUtils .setParameterValue (ps , argIndx ++, this .argTypes [i ], argValue );
68
+ doSetValue (ps , parameterPosition , this .argTypes [i ], argValue );
69
+ parameterPosition ++;
69
70
}
70
71
}
71
72
else {
72
- StatementCreatorUtils .setParameterValue (ps , argIndx ++, this .argTypes [i ], entry );
73
+ doSetValue (ps , parameterPosition , this .argTypes [i ], entry );
74
+ parameterPosition ++;
73
75
}
74
76
}
75
77
}
76
78
else {
77
- StatementCreatorUtils .setParameterValue (ps , argIndx ++, this .argTypes [i ], arg );
79
+ doSetValue (ps , parameterPosition , this .argTypes [i ], arg );
80
+ parameterPosition ++;
78
81
}
79
82
}
80
83
}
81
84
}
82
85
86
+ /**
87
+ * Set the value for the prepared statement's specified parameter position using the passed in
88
+ * value and type. This method can be overridden by sub-classes if needed.
89
+ * @param ps the PreparedStatement
90
+ * @param parameterPosition index of the parameter position
91
+ * @param argType the argument type
92
+ * @param argValue the argument value
93
+ * @throws SQLException
94
+ */
95
+ protected void doSetValue (PreparedStatement ps , int parameterPosition , int argType , Object argValue )
96
+ throws SQLException {
97
+ StatementCreatorUtils .setParameterValue (ps , parameterPosition , argType , argValue );
98
+ }
99
+
83
100
public void cleanupParameters () {
84
101
StatementCreatorUtils .cleanupParameters (this .args );
85
102
}
0 commit comments