}
public void write(PreparedStatement statement, List<ColumnInfo> columnMetadataList) throws SQLException {
for (int i = 0; i < columnMetadataList.size(); i++) {
Object o = values.get(i);
ColumnInfo columnInfo = columnMetadataList.get(i);
byte type = (fieldSchemas == null) ? DataType.findType(o) : fieldSchemas[i].getType();
try {
Object upsertValue = convertTypeSpecificValue(o, type, columnInfo.getSqlType());
if (upsertValue != null) {
statement.setObject(i + 1, upsertValue, columnInfo.getSqlType());
} else {
statement.setNull(i + 1, columnInfo.getSqlType());
}
} catch (RuntimeException re) {
throw new RuntimeException(String.format("Unable to process column %s, innerMessage=%s"
,columnInfo.toString(),re.getMessage()),re);
}
}
statement.execute();