- for (int col = 0; col < data.length; ++col) {
- Object obj = data[col];
- Column column = table.getColumn(col);
- if (column.getType().equals(Type.TIMESTAMPTZ)) {
- // Special case: because there's no good way to read a TIMESTAMPTZ from
- // the database using JDBC, we store it as an integer (milliseconds since
- // the epoch, 01.01.1970 00:00:00.000 UTC).
- Date date = (Date)obj;
- ps.setLong(col + 1, date.getTime());
- }
- else {
- ps.setObject(col + 1, data[col]);
- }
+ for (int idx = 0; idx < data.length; ++idx) {
+ Object obj = data[idx];
+ Column column = table.getColumn(idx);
+ column.setObject(ps, idx + 1, obj);