StringBuilder names = new StringBuilder();
StringBuilder values = new StringBuilder();
int maxSize = rd.getSize();
int positionIndex = 0;
ColumnInfo ci = null;
int i = 0;
for (i = 0; i < maxSize - 1; i++) {
ci = ri.getColumnInfo(i);
if (ci.isPrimaryKey() && autoPopulatePrimaryKey) continue;
if (ci.isReadOnly() || !ci.isWritable()) continue;
if (changedOnly && !modifiedColumns.contains(ci.getColumnName())) continue;
names.append(ci.getColumnName()).append(", ");
values.append("?, ");
positionIndex = positionIndex + 1;
outs.put(positionIndex+"", rd.getField(i));
}
//the last column: i=maxSize-1
ci = ri.getColumnInfo(i);
if (!ci.isReadOnly()
&& ci.isWritable()
&& (!changedOnly || changedOnly
&& modifiedColumns.contains(ci.getColumnName()))) {
names.append(ci.getColumnName()).append("");
values.append("?");
positionIndex = positionIndex + 1;
outs.put(positionIndex+"", rd.getField(i));
}