diff --git a/jrunner/src/main/java/jrunner/jrunner.java b/jrunner/src/main/java/jrunner/jrunner.java index 70d9c4d..7abef0d 100644 --- a/jrunner/src/main/java/jrunner/jrunner.java +++ b/jrunner/src/main/java/jrunner/jrunner.java @@ -325,8 +325,10 @@ public class jrunner { BulkSource src = new BulkSource(rs, cols, dtn, trim); bulkCopy.writeToServer(src); bulkCopy.close(); - // print the count so the trailing " rows written" line is parseable - System.out.print(src.rowsWritten()); + // leading \r starts a fresh line so the count doesn't concatenate + // onto the last progress tick; the trailing " rows written" makes + // it parseable. + System.out.print("\r" + src.rowsWritten()); } catch (Exception e) { e.printStackTrace(); System.exit(0); @@ -604,6 +606,9 @@ public class jrunner { public Object[] getRowData() throws SQLServerException { rows++; + // live progress: emit an in-place counter every 10k rows (the + // caller pulls one row at a time, so this runs during the load). + if (rows % 10000 == 0) { System.out.print("\r" + rows); System.out.flush(); } Object[] row = new Object[cols]; try { for (int i = 1; i <= cols; i++) {