* Binds BatchQuery parameters to the PreparedStatement.
*/
public void bindParameters(PreparedStatement statement, BatchQuery query)
throws SQLException, Exception {
UpdateBatchQuery updateBatch = (UpdateBatchQuery) query;
List qualifierAttributes = updateBatch.getQualifierAttributes();
List updatedDbAttributes = updateBatch.getUpdatedAttributes();
int len = updatedDbAttributes.size();
int parameterIndex = 1;
for (int i = 0; i < len; i++) {
Object value = query.getValue(i);
DbAttribute attribute = (DbAttribute) updatedDbAttributes.get(i);
adapter.bindParameter(
statement,
value,
parameterIndex++,
attribute.getType(),
attribute.getPrecision());
}
for (int i = 0; i < qualifierAttributes.size(); i++) {
Object value = query.getValue(len + i);
DbAttribute attribute = (DbAttribute) qualifierAttributes.get(i);
// skip null attributes... they are translated as "IS NULL"
if (updateBatch.isNull(attribute)) {
continue;
}
adapter.bindParameter(
statement,