Class Hierarchy    Previous  Next  Index

Class COM.cloudscape.util.JDBCDisplayUtil

java.lang.Object
    |
    +----COM.cloudscape.util.JDBCDisplayUtil

public class JDBCDisplayUtil
extends java.lang.Object
Copyright © 1998-2000, Informix Software, Inc. All rights reserved.

This class contains utility methods for displaying JDBC objects and results on a console/ASCII terminal.

All of the methods are static. The output stream to write to is always passed in, along with the JDBC objects to display.


Variable Index

 o showSelectCount
 

Method Index

 o checkNotNull(Object, String)
Check if an object is null, and if it is, throw an exception with an informative parameter about what was null.
 o DisplayBanner(PrintStream, ResultSetMetaData)
 
 o DisplayBanner(PrintWriter, ResultSetMetaData)
Print a banner containing the column labels separated with '|'s and a line of '-'s.
 o DisplayCurrentRow(PrintStream, ResultSet, Connection)
 
 o DisplayCurrentRow(PrintWriter, ResultSet, Connection)
Display the current row of the result set along with a banner.
 o DisplayNextRow(PrintStream, ResultSet, Connection)
 
 o DisplayNextRow(PrintWriter, ResultSet, Connection)
Fetch the next row of the result set, and if it exists format and display a banner and the row.
 o DisplayResults(PrintStream, ResultSet, Connection)
 
 o DisplayResults(PrintStream, Statement, Connection)
 
 o DisplayResults(PrintWriter, ResultSet, Connection)
 
 o DisplayResults(PrintWriter, Statement, Connection)
Pretty-print the results of a statement that has been executed.
 o doTrace(PrintStream, Exception)
 
 o doTrace(PrintWriter, Exception)
If the property ij.exceptionTrace is true, display the stack trace to the print stream.
 o init()
init method - will init the class to support a locale and codeset based on the cloudscape.ui.locale and cloudscape.ui.codeset properties if exists or using the default values from the JVM.
 o init(String)
init method - will init the class to support a locale and codeset based on the cloudscape.ui.locale properties and on the given codeset if exists or using the default values from the JVM.
 o init(String, String)
init method - will init the class to support a locale and codeset based on the given codeset and locale.
 o mapNull(String, String)
Map the string to the value if it is null.
 o setMaxDisplayWidth(int)
 
 o ShowException(PrintStream, Throwable)
 
 o ShowException(PrintWriter, Throwable)
Print information about the exception to the given PrintWriter.
 o ShowSQLException(PrintStream, SQLException)
 
 o ShowSQLException(PrintWriter, SQLException)
Print information about the SQL exception to the given PrintWriter.
 o ShowWarnings(PrintStream, Connection)
 
 o ShowWarnings(PrintStream, ResultSet)
 
 o ShowWarnings(PrintStream, SQLWarning)
 
 o ShowWarnings(PrintStream, Statement)
 
 o ShowWarnings(PrintWriter, Connection)
Print information about the SQL warnings for the connection to the given PrintWriter.
 o ShowWarnings(PrintWriter, ResultSet)
Print information about the SQL warnings for the ResultSet to the given PrintWriter.
 o ShowWarnings(PrintWriter, SQLWarning)
 
 o ShowWarnings(PrintWriter, Statement)
Print information about the SQL warnings for the Statement to the given PrintWriter.

Field Detail

 o showSelectCount
public static boolean showSelectCount

Method Detail

 o init
public static boolean init()
          init method - will init the class to support a locale and codeset based on the cloudscape.ui.locale and cloudscape.ui.codeset properties if exists or using the default values from the JVM.
 o init
public static boolean init(java.lang.String codeset)
          init method - will init the class to support a locale and codeset based on the cloudscape.ui.locale properties and on the given codeset if exists or using the default values from the JVM.
 o init
public static boolean init(java.lang.String pCodeset,
                           java.lang.String pLocale)
          init method - will init the class to support a locale and codeset based on the given codeset and locale. If the parameters are null it will try to init use cloudscape.ui.locale and cloudscape.ui.codeset properties if exists or using the default values from the JVM.
 o ShowException
public static void ShowException(java.io.PrintWriter out,
                                 java.lang.Throwable e)
          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
e - the exception to display
 o ShowSQLException
public static void ShowSQLException(java.io.PrintWriter out,
                                    java.sql.SQLException e)
          Print information about the SQL exception to the given PrintWriter. Walk the list of exceptions, if any.
Parameters:
out - the place to write to
e - the exception to display
 o ShowWarnings
public static void ShowWarnings(java.io.PrintWriter out,
                                java.sql.Connection theConnection)
          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
theConnection - the connection that may have warnings.
 o ShowWarnings
public static void ShowWarnings(java.io.PrintWriter out,
                                java.sql.SQLWarning warning)
Parameters:
out - the place to write to
warning - the SQLWarning
 o ShowWarnings
public static void ShowWarnings(java.io.PrintWriter out,
                                java.sql.ResultSet rs)
          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
rs - the ResultSet that may have warnings on it
 o ShowWarnings
public static void ShowWarnings(java.io.PrintWriter out,
                                java.sql.Statement s)
          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
s - the Statement that may have warnings on it
 o DisplayResults
public static void DisplayResults(java.io.PrintWriter out,
                                  java.sql.Statement stmt,
                                  java.sql.Connection conn) throws java.sql.SQLException
          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
stmt - the Statement to display
conn - the Connection against which the statement was executed
Throws:
java.sql.SQLException - on JDBC access failure
 o DisplayResults
public static void DisplayResults(java.io.PrintWriter out,
                                  java.sql.ResultSet rs,
                                  java.sql.Connection conn) throws java.sql.SQLException
Parameters:
out - the place to write to
rs - the ResultSet to display
conn - the Connection against which the ResultSet was retrieved
Throws:
java.sql.SQLException - on JDBC access failure
 o DisplayNextRow
public static void DisplayNextRow(java.io.PrintWriter out,
                                  java.sql.ResultSet rs,
                                  java.sql.Connection conn) throws java.sql.SQLException
          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
rs - the ResultSet in use
conn - the Connection against which the ResultSet was retrieved
Throws:
java.sql.SQLException - on JDBC access failure
 o DisplayCurrentRow
public static void DisplayCurrentRow(java.io.PrintWriter out,
                                     java.sql.ResultSet rs,
                                     java.sql.Connection conn) throws java.sql.SQLException
          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
rs - the ResultSet in use
conn - the Connection against which the ResultSet was retrieved
Throws:
java.sql.SQLException - on JDBC access failure
 o DisplayBanner
public static int DisplayBanner(java.io.PrintWriter out,
                                java.sql.ResultSetMetaData rsmd) throws java.sql.SQLException
          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
rsmd - the ResultSetMetaData to use
Throws:
java.sql.SQLException - on JDBC access failure
 o checkNotNull
public static void checkNotNull(java.lang.Object o,
                                java.lang.String what)
          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
what - the information to include in the error if it is null
 o mapNull
public static java.lang.String mapNull(java.lang.String s,
                             java.lang.String nullValue)
          Map the string to the value if it is null.
Parameters:
s - the string to test for null
nullValue - the value to use if s is null
Returns:
if s is non-null, s; else nullValue.
 o doTrace
public static void doTrace(java.io.PrintWriter out,
                           java.lang.Exception e)
          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
e - the exception to display
 o setMaxDisplayWidth
public static void setMaxDisplayWidth(int maxDisplayWidth)
 o ShowException
public static void ShowException(java.io.PrintStream out,
                                 java.lang.Throwable e)
 o ShowSQLException
public static void ShowSQLException(java.io.PrintStream out,
                                    java.sql.SQLException e)
 o ShowWarnings
public static void ShowWarnings(java.io.PrintStream out,
                                java.sql.Connection theConnection)
 o ShowWarnings
public static void ShowWarnings(java.io.PrintStream out,
                                java.sql.SQLWarning warning)
 o ShowWarnings
public static void ShowWarnings(java.io.PrintStream out,
                                java.sql.ResultSet rs)
 o ShowWarnings
public static void ShowWarnings(java.io.PrintStream out,
                                java.sql.Statement s)
 o DisplayResults
public static void DisplayResults(java.io.PrintStream out,
                                  java.sql.Statement stmt,
                                  java.sql.Connection conn) throws java.sql.SQLException
 o DisplayResults
public static void DisplayResults(java.io.PrintStream out,
                                  java.sql.ResultSet rs,
                                  java.sql.Connection conn) throws java.sql.SQLException
 o DisplayNextRow
public static void DisplayNextRow(java.io.PrintStream out,
                                  java.sql.ResultSet rs,
                                  java.sql.Connection conn) throws java.sql.SQLException
 o DisplayCurrentRow
public static void DisplayCurrentRow(java.io.PrintStream out,
                                     java.sql.ResultSet rs,
                                     java.sql.Connection conn) throws java.sql.SQLException
 o DisplayBanner
public static int DisplayBanner(java.io.PrintStream out,
                                java.sql.ResultSetMetaData rsmd) throws java.sql.SQLException
 o doTrace
public static void doTrace(java.io.PrintStream out,
                           java.lang.Exception e)

  Class Hierarchy    Previous  Next  Index