Add "Describe" command, with support for describing both (a) specific table(s) and...
[squelch.git] / src / main / java / net / jaekl / squelch / stmt / Tabular.java
index af3d5da360933f8c37e48c216187236fd047bdde..130f4a563eefaef9977c7e56ccc12ea597368557 100644 (file)
@@ -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();