--- a/java/sql-dk/src/info/globalcode/sql/dk/formatting/AbstractFormatter.java Fri Dec 20 22:58:02 2013 +0100
+++ b/java/sql-dk/src/info/globalcode/sql/dk/formatting/AbstractFormatter.java Fri Dec 20 23:50:21 2013 +0100
@@ -34,6 +34,7 @@
private ColumnsHeader currentColumnsHeader;
private String currentQuery;
private int currentColumnsCount;
+ private int currentRowCount;
public AbstractFormatter(FormatterContext formatterContext) {
this.formatterContext = formatterContext;
@@ -132,6 +133,7 @@
@Override
public void writeStartResultSet() {
pushState(State.RESULT_SET, EnumSet.of(State.DATABASE, State.GENERATED_KEYS));
+ currentRowCount = 0;
}
@Override
@@ -179,6 +181,7 @@
public void writeStartRow() {
pushState(State.ROW, EnumSet.of(State.RESULT_SET));
currentColumnsCount = 0;
+ currentRowCount++;
}
@Override
@@ -231,9 +234,19 @@
return currentColumnsHeader;
}
+ /**
+ * @return column number, 1 = first
+ */
protected int getCurrentColumnsCount() {
return currentColumnsCount;
}
+
+ /**
+ * @return row number, 1 = first
+ */
+ protected int getCurrentRowCount() {
+ return currentRowCount;
+ }
/**
* TODO: write SQLWarning
*/