projects
/
squelch.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add "Describe" command, with support for describing both (a) specific table(s) and...
[squelch.git]
/
src
/
main
/
java
/
net
/
jaekl
/
squelch
/
stmt
/
Tabular.java
diff --git
a/src/main/java/net/jaekl/squelch/stmt/Tabular.java
b/src/main/java/net/jaekl/squelch/stmt/Tabular.java
index af3d5da360933f8c37e48c216187236fd047bdde..130f4a563eefaef9977c7e56ccc12ea597368557 100644
(file)
--- 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
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;
int rowCount = 0;
Column[] cols = getCols();
RowBuffer rowBuf;
@@
-68,10
+70,13
@@
abstract public class Tabular {
if (rowCount > 0) {
writeDivider(pw, colWidths);
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;
pw.flush();
return rowCount;
@@
-206,7
+211,7
@@
abstract public class Tabular {
}
return Object.class;
}
}
return Object.class;
}
-
+
String repChar(char chr, int times)
{
StringBuffer sb = new StringBuffer();
String repChar(char chr, int times)
{
StringBuffer sb = new StringBuffer();