public class JDBCDisplayUtil extends Object
All of the methods are static. The output stream to write to is always passed in, along with the JDBC objects to display.
| Modifier and Type | Field and Description |
|---|---|
static boolean |
showSelectCount |
static boolean |
showSelectRows |
| Constructor and Description |
|---|
JDBCDisplayUtil() |
| Modifier and Type | Method and Description |
|---|---|
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.
|
static int |
DisplayBanner(PrintStream out,
ResultSetMetaData rsmd) |
static int |
DisplayBanner(PrintWriter out,
ResultSetMetaData rsmd)
Print a banner containing the column labels separated with '|'s
and a line of '-'s.
|
static void |
DisplayCurrentRow(PrintStream out,
ResultSet rs,
Connection conn) |
static void |
DisplayCurrentRow(PrintWriter out,
ResultSet rs,
Connection conn,
scala.tools.jline.console.ConsoleReader reader,
com.pivotal.gemfirexd.internal.shared.common.StopWatch timer)
Display the current row of the result set along with
a banner.
|
static void |
DisplayMultipleResults(PrintWriter out,
List resultSets,
Connection conn,
int[] displayColumns,
int[] displayColumnWidths,
scala.tools.jline.console.ConsoleReader reader,
com.pivotal.gemfirexd.internal.shared.common.StopWatch timer) |
static void |
DisplayNextRow(PrintStream out,
ResultSet rs,
Connection conn) |
static void |
DisplayNextRow(PrintWriter out,
ResultSet rs,
Connection conn,
scala.tools.jline.console.ConsoleReader reader,
com.pivotal.gemfirexd.internal.shared.common.StopWatch timer)
Fetch the next row of the result set, and if it
exists format and display a banner and the row.
|
static void |
DisplayResults(PrintStream out,
ResultSet rs,
Connection conn) |
static void |
DisplayResults(PrintStream out,
Statement stmt,
Connection conn) |
static void |
DisplayResults(PrintWriter out,
ResultSet rs,
Connection conn,
int[] displayColumns,
int[] displayColumnWidths,
scala.tools.jline.console.ConsoleReader reader,
com.pivotal.gemfirexd.internal.shared.common.StopWatch timer) |
static void |
DisplayResults(PrintWriter out,
Statement stmt,
Connection conn,
scala.tools.jline.console.ConsoleReader reader,
com.pivotal.gemfirexd.internal.shared.common.StopWatch timer)
Pretty-print the results of a statement that has been executed.
|
static void |
doTrace(PrintStream out,
Exception e) |
static void |
doTrace(PrintWriter out,
Exception e)
If the property gfxd.exceptionTrace is true, display the stack
trace to the print stream.
|
static int |
getMaxColumnWidth(String columnName) |
static int |
getMaxColumnWidthExplicit(String columnName) |
static int |
getMaxDisplayWidth() |
static int |
getMaxLineWidth() |
static String |
mapNull(String s,
String nullValue)
Map the string to the value if it is null.
|
static void |
setMaxDisplayWidth(int maxDisplayWidth) |
static void |
setMaxDisplayWidth(String columnName,
int maxDisplayWidth) |
static void |
setMaxLineWidth(int width,
boolean explicit) |
static void |
setPaging(boolean on) |
static void |
ShowException(PrintStream out,
Throwable e) |
static void |
ShowException(PrintWriter out,
Throwable e)
Print information about the exception to the given PrintWriter.
|
static void |
ShowSQLException(PrintStream out,
SQLException e) |
static void |
ShowSQLException(PrintWriter out,
SQLException e)
Print information about the SQL exception to the given PrintWriter.
|
static void |
ShowWarnings(PrintStream out,
Connection theConnection) |
static void |
ShowWarnings(PrintStream out,
ResultSet rs) |
static void |
ShowWarnings(PrintStream out,
SQLWarning warning) |
static void |
ShowWarnings(PrintStream out,
Statement s) |
static void |
ShowWarnings(PrintWriter out,
Connection theConnection)
Print information about the SQL warnings for the connection
to the given PrintWriter.
|
static int |
ShowWarnings(PrintWriter out,
ResultSet rs)
Print information about the SQL warnings for the ResultSet
to the given PrintWriter.
|
static int |
ShowWarnings(PrintWriter out,
SQLWarning warning) |
static void |
ShowWarnings(PrintWriter out,
Statement s)
Print information about the SQL warnings for the Statement
to the given PrintWriter.
|
public static boolean showSelectCount
public static boolean showSelectRows
public static void ShowException(PrintWriter out, Throwable e)
out - the place to write toe - the exception to displaypublic static void ShowSQLException(PrintWriter out, SQLException e)
out - the place to write toe - the exception to displaypublic static void ShowWarnings(PrintWriter out, Connection theConnection)
out - the place to write totheConnection - the connection that may have warnings.public static int ShowWarnings(PrintWriter out, SQLWarning warning)
out - the place to write towarning - the SQLWarningpublic static int ShowWarnings(PrintWriter out, ResultSet rs)
out - the place to write tors - the ResultSet that may have warnings on itpublic static void ShowWarnings(PrintWriter out, Statement s)
out - the place to write tos - the Statement that may have warnings on itpublic static void DisplayResults(PrintWriter out, Statement stmt, Connection conn, scala.tools.jline.console.ConsoleReader reader, com.pivotal.gemfirexd.internal.shared.common.StopWatch timer) throws SQLException
out - the place to write tostmt - the Statement to displayconn - the Connection against which the statement was executedSQLException - on JDBC access failurepublic static void DisplayMultipleResults(PrintWriter out, List resultSets, Connection conn, int[] displayColumns, int[] displayColumnWidths, scala.tools.jline.console.ConsoleReader reader, com.pivotal.gemfirexd.internal.shared.common.StopWatch timer) throws SQLException
out - the place to write toresultSets - list of ResultSets to displayconn - the connection against which the ResultSets
were retrieveddisplayColumns - column numbers to display, null if alldisplayColumnWidths - column widths, in characters, if
displayColumns is specifiedSQLException - on JDBC access failurepublic static void DisplayResults(PrintWriter out, ResultSet rs, Connection conn, int[] displayColumns, int[] displayColumnWidths, scala.tools.jline.console.ConsoleReader reader, com.pivotal.gemfirexd.internal.shared.common.StopWatch timer) throws SQLException
out - the place to write tors - the ResultSet to displayconn - the connection against which the ResultSet
was retrieveddisplayColumns - column numbers to display, null if alldisplayColumnWidths - column widths, in characters, if
displayColumns is specifiedSQLException - on JDBC access failurepublic static void DisplayNextRow(PrintWriter out, ResultSet rs, Connection conn, scala.tools.jline.console.ConsoleReader reader, com.pivotal.gemfirexd.internal.shared.common.StopWatch timer) throws SQLException
out - the place to write tors - the ResultSet in useconn - the Connection against which the ResultSet was retrievedSQLException - on JDBC access failurepublic static void DisplayCurrentRow(PrintWriter out, ResultSet rs, Connection conn, scala.tools.jline.console.ConsoleReader reader, com.pivotal.gemfirexd.internal.shared.common.StopWatch timer) throws SQLException
out - the place to write tors - the ResultSet in useconn - the Connection against which the ResultSet was retrievedSQLException - on JDBC access failurepublic static int DisplayBanner(PrintWriter out, ResultSetMetaData rsmd) throws SQLException
out - the place to write torsmd - the ResultSetMetaData to useSQLException - on JDBC access failurepublic static void checkNotNull(Object o, String what)
o - the object to testwhat - the information to include in the error if it is nullpublic static String mapNull(String s, String nullValue)
s - the string to test for nullnullValue - the value to use if s is nullpublic static void doTrace(PrintWriter out, Exception e)
out - the output stream to write toe - the exception to displaypublic static void setMaxDisplayWidth(int maxDisplayWidth)
public static void ShowException(PrintStream out, Throwable e)
public static void ShowSQLException(PrintStream out, SQLException e)
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 DisplayResults(PrintStream out, Statement stmt, Connection conn) throws SQLException
SQLExceptionpublic static void DisplayResults(PrintStream out, ResultSet rs, Connection conn) throws SQLException
SQLExceptionpublic static void DisplayNextRow(PrintStream out, ResultSet rs, Connection conn) throws SQLException
SQLExceptionpublic static void DisplayCurrentRow(PrintStream out, ResultSet rs, Connection conn) throws SQLException
SQLExceptionpublic static int DisplayBanner(PrintStream out, ResultSetMetaData rsmd) throws SQLException
SQLExceptionpublic static void doTrace(PrintStream out, Exception e)
public static void setMaxLineWidth(int width,
boolean explicit)
public static int getMaxDisplayWidth()
public static int getMaxColumnWidth(String columnName)
public static int getMaxColumnWidthExplicit(String columnName)
public static int getMaxLineWidth()
public static void setMaxDisplayWidth(String columnName, int maxDisplayWidth)
public static void setPaging(boolean on)
Copyright © 2010-2015 Pivotal Software, Inc. All rights reserved.