X-Git-Url: http://jaekl.net/gitweb/?p=squelch.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fjaekl%2Fsquelch%2Fstmt%2FTabular.java;h=130f4a563eefaef9977c7e56ccc12ea597368557;hp=af3d5da360933f8c37e48c216187236fd047bdde;hb=5c97ab69edb44c0f1a7dc416ffaf1b934f7a3d7d;hpb=dde7f6828b7e2fc479d2285754e4a150be7958a5 diff --git a/src/main/java/net/jaekl/squelch/stmt/Tabular.java b/src/main/java/net/jaekl/squelch/stmt/Tabular.java index af3d5da..130f4a5 100644 --- a/src/main/java/net/jaekl/squelch/stmt/Tabular.java +++ b/src/main/java/net/jaekl/squelch/stmt/Tabular.java @@ -41,7 +41,9 @@ abstract public class Tabular { abstract Row getNext() throws SQLException; // Returns the number of (data) rows that were output - public int printTable(PrintWriter pw) throws SQLException { + public int printTable(PrintWriter pw, String noRowsMessage) + throws SQLException + { int rowCount = 0; Column[] cols = getCols(); RowBuffer rowBuf; @@ -68,10 +70,13 @@ abstract public class Tabular { if (rowCount > 0) { writeDivider(pw, colWidths); + // TODO: Implement a String table for i18n + pw.println("" + rowCount + " row(s) returned."); + } + else { + pw.println(noRowsMessage); } - // TODO: Implement a String table for i18n - pw.println("" + rowCount + " row(s) returned."); pw.flush(); return rowCount; @@ -206,7 +211,7 @@ abstract public class Tabular { } return Object.class; } - + String repChar(char chr, int times) { StringBuffer sb = new StringBuffer();