| java.lang.Object org.apache.derby.tools.JDBCDisplayUtil
All known Subclasses: org.apache.derbyTesting.functionTests.util.JDBCTestDisplayUtil,
JDBCDisplayUtil | public class JDBCDisplayUtil (Code) | | This class contains utility methods for displaying JDBC objects and results.
All of the methods are static. The output stream
to write to is always passed in, along with the
JDBC objects to display.
author: ames |
Method Summary | |
public static int | DisplayBanner(PrintWriter out, ResultSetMetaData rsmd) Print a banner containing the column labels separated with '|'s
and a line of '-'s. | public static int | DisplayBanner(PrintStream out, ResultSetMetaData rsmd) | public static void | DisplayCurrentRow(PrintWriter out, ResultSet rs, Connection conn) Display the current row of the result set along with
a banner. | public static void | DisplayCurrentRow(PrintStream out, ResultSet rs, Connection conn) | public static void | DisplayNextRow(PrintWriter out, ResultSet rs, Connection conn) Fetch the next row of the result set, and if it
exists format and display a banner and the row. | public static void | DisplayNextRow(PrintStream out, ResultSet rs, Connection conn) | public static void | DisplayResults(PrintWriter out, Statement stmt, Connection conn) Pretty-print the results of a statement that has been executed.
If it is a select, gathers and prints the results. | public static void | DisplayResults(PrintWriter out, ResultSet rs, Connection conn, int[] displayColumns, int[] displayColumnWidths) | public static void | DisplayResults(PrintStream out, Statement stmt, Connection conn) | public static void | DisplayResults(PrintStream out, ResultSet rs, Connection conn) | static void | DisplayUpdateCount(PrintWriter out, int count, int indentLevel) | static void | DisplayUpdateCount(PrintStream out, int count, int indentLevel) | public static void | ShowException(PrintWriter out, Throwable e) Print information about the exception to the given PrintWriter.
For non-SQLExceptions, does a stack trace. | public static void | ShowException(PrintStream out, Throwable e) | public static void | ShowSQLException(PrintWriter out, SQLException e) Print information about the SQL exception to the given PrintWriter. | public static void | ShowSQLException(PrintStream out, SQLException e) | public static void | ShowWarnings(PrintWriter out, Connection theConnection) Print information about the SQL warnings for the connection
to the given PrintWriter. | public static void | ShowWarnings(PrintWriter out, SQLWarning warning) | public static void | ShowWarnings(PrintWriter out, ResultSet rs) Print information about the SQL warnings for the ResultSet
to the given PrintWriter. | public static void | ShowWarnings(PrintWriter out, Statement s) Print information about the SQL warnings for the Statement
to the given PrintWriter. | public static void | ShowWarnings(PrintStream out, Connection theConnection) | public static void | ShowWarnings(PrintStream out, SQLWarning warning) | public static void | ShowWarnings(PrintStream out, ResultSet rs) | public static void | ShowWarnings(PrintStream out, Statement s) | public static void | checkNotNull(Object o, String what) Check if an object is null, and if it is, throw an exception
with an informative parameter about what was null. | public static void | doTrace(PrintWriter out, Exception e) If the property ij.exceptionTrace is true, display the stack
trace to the print stream. | public static void | doTrace(PrintStream out, Exception e) | public static String | mapNull(String s, String nullValue) Map the string to the value if it is null. | public static void | setMaxDisplayWidth(int maxDisplayWidth) |
showSelectCount | public static boolean showSelectCount(Code) | | |
DisplayBanner | public static int DisplayBanner(PrintWriter out, ResultSetMetaData rsmd) throws SQLException(Code) | | Print a banner containing the column labels separated with '|'s
and a line of '-'s. Each field is as wide as the display
width reported by the metadata.
Parameters: out - the place to write to Parameters: rsmd - the ResultSetMetaData to use exception: SQLException - on JDBC access failure |
DisplayCurrentRow | public static void DisplayCurrentRow(PrintWriter out, ResultSet rs, Connection conn) throws SQLException(Code) | | Display the current row of the result set along with
a banner. Assume the result set is on a row.
Parameters: out - the place to write to Parameters: rs - the ResultSet in use Parameters: conn - the Connection against which the ResultSet was retrieved exception: SQLException - on JDBC access failure |
DisplayNextRow | public static void DisplayNextRow(PrintWriter out, ResultSet rs, Connection conn) throws SQLException(Code) | | Fetch the next row of the result set, and if it
exists format and display a banner and the row.
Parameters: out - the place to write to Parameters: rs - the ResultSet in use Parameters: conn - the Connection against which the ResultSet was retrieved exception: SQLException - on JDBC access failure |
DisplayResults | public static void DisplayResults(PrintWriter out, Statement stmt, Connection conn) throws SQLException(Code) | | Pretty-print the results of a statement that has been executed.
If it is a select, gathers and prints the results. Display
partial results up to the first error.
If it is not a SELECT, determine if rows were involved or not,
and print the appropriate message.
Parameters: out - the place to write to Parameters: stmt - the Statement to display Parameters: conn - the Connection against which the statement was executed exception: SQLException - on JDBC access failure |
DisplayResults | public static void DisplayResults(PrintWriter out, ResultSet rs, Connection conn, int[] displayColumns, int[] displayColumnWidths) throws SQLException(Code) | | Parameters: out - the place to write to Parameters: rs - the ResultSet to display Parameters: conn - the Connection against which the ResultSet was retrieved Parameters: displayColumns - Column numbers to display, or null if all Parameters: displayColumnWidths - Column widths, in characters, if displayColumns is specified. exception: SQLException - on JDBC access failure |
DisplayUpdateCount | static void DisplayUpdateCount(PrintWriter out, int count, int indentLevel)(Code) | | Parameters: out - the place to write to Parameters: count - the update count to display Parameters: indentLevel - number of tab stops to indent line |
DisplayUpdateCount | static void DisplayUpdateCount(PrintStream out, int count, int indentLevel)(Code) | | |
ShowException | public static void ShowException(PrintWriter out, Throwable e)(Code) | | Print information about the exception to the given PrintWriter.
For non-SQLExceptions, does a stack trace. For SQLExceptions,
print a standard error message and walk the list, if any.
Parameters: out - the place to write to Parameters: e - the exception to display |
ShowSQLException | public static void ShowSQLException(PrintWriter out, SQLException e)(Code) | | Print information about the SQL exception to the given PrintWriter.
Walk the list of exceptions, if any.
Parameters: out - the place to write to Parameters: e - the exception to display |
ShowWarnings | public static void ShowWarnings(PrintWriter out, Connection theConnection)(Code) | | Print information about the SQL warnings for the connection
to the given PrintWriter.
Walks the list of exceptions, if any.
Parameters: out - the place to write to Parameters: theConnection - the connection that may have warnings. |
ShowWarnings | public static void ShowWarnings(PrintWriter out, SQLWarning warning)(Code) | | Parameters: out - the place to write to Parameters: warning - the SQLWarning |
ShowWarnings | public static void ShowWarnings(PrintWriter out, ResultSet rs)(Code) | | Print information about the SQL warnings for the ResultSet
to the given PrintWriter.
Walk the list of exceptions, if any.
Parameters: out - the place to write to Parameters: rs - the ResultSet that may have warnings on it |
ShowWarnings | public static void ShowWarnings(PrintWriter out, Statement s)(Code) | | Print information about the SQL warnings for the Statement
to the given PrintWriter.
Walks the list of exceptions, if any.
Parameters: out - the place to write to Parameters: s - the Statement that may have warnings on it |
checkNotNull | public static void checkNotNull(Object o, String what)(Code) | | Check if an object is null, and if it is, throw an exception
with an informative parameter about what was null.
The exception is a run-time exception that is internal to ij.
Parameters: o - the object to test Parameters: what - the information to include in the error if it is null |
doTrace | public static void doTrace(PrintWriter out, Exception e)(Code) | | If the property ij.exceptionTrace is true, display the stack
trace to the print stream. Otherwise, do nothing.
Parameters: out - the output stream to write to Parameters: e - the exception to display |
mapNull | public static String mapNull(String s, String nullValue)(Code) | | Map the string to the value if it is null.
Parameters: s - the string to test for null Parameters: nullValue - the value to use if s is null if s is non-null, s; else nullValue. |
setMaxDisplayWidth | public static void setMaxDisplayWidth(int maxDisplayWidth)(Code) | | |
|
|