Commit 1cb45e4e authored by Matija Obreza's avatar Matija Obreza
Browse files

One-off bug

parent 6ded8122
...@@ -204,7 +204,7 @@ public class PushDialog extends Dialog { ...@@ -204,7 +204,7 @@ public class PushDialog extends Dialog {
} }
if (count % 100 == 0) if (count % 100 == 0)
_log.info("Examining data at row " + count); _log.debug("Examining data at row " + count);
for (Object[] row : rows) { for (Object[] row : rows) {
count++; count++;
......
...@@ -27,7 +27,6 @@ public class JdbcRowReader implements RowReader { ...@@ -27,7 +27,6 @@ public class JdbcRowReader implements RowReader {
@Override @Override
public List<Object[]> readRows(int rowsToRead) throws IOException { public List<Object[]> readRows(int rowsToRead) throws IOException {
List<Object[]> rows = new ArrayList<Object[]>(rowsToRead);
try { try {
if (this.preparedStatement == null) { if (this.preparedStatement == null) {
this.preparedStatement = conn.prepareStatement(query); this.preparedStatement = conn.prepareStatement(query);
...@@ -37,13 +36,16 @@ public class JdbcRowReader implements RowReader { ...@@ -37,13 +36,16 @@ public class JdbcRowReader implements RowReader {
this.columnCount = metadata.getColumnCount(); this.columnCount = metadata.getColumnCount();
} }
while (res.next()) { List<Object[]> rows = new ArrayList<Object[]>(rowsToRead);
int rowCount = 0;
while (res.next() && rowCount<rowsToRead) {
List<Object> row = new ArrayList<Object>(); List<Object> row = new ArrayList<Object>();
for (int i = 1; i < columnCount; i++) { for (int i = 1; i <= columnCount; i++) {
Object val = res.getObject(i); Object val = res.getObject(i);
row.add(val); row.add(val);
} }
rows.add(row.toArray()); rows.add(row.toArray());
rowCount++;
} }
return rows; return rows;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment