org.objectweb.cjdbc.console.text.formatter
Class ResultSetFormatter

java.lang.Object
  extended byorg.objectweb.cjdbc.console.text.formatter.ResultSetFormatter

public class ResultSetFormatter
extends java.lang.Object

Utility class to format a ResultSet to display it prettily in the text console

Author:
Jeff Mesnil

Field Summary
private static int MAX_COLUMN_DISPLAY_WIDTH
          Max column width when displaying a ResultSet.
 
Constructor Summary
ResultSetFormatter()
           
 
Method Summary
private static void appendPad(java.lang.String text, int size, Console console)
           
private static void appendSeparatorLine(int columnCount, java.sql.ResultSetMetaData meta, Console console)
           
static void formatAndDisplay(java.sql.ResultSet rs, int fetchsize, Console console)
          Format and display the given ResultSet on the console.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_COLUMN_DISPLAY_WIDTH

private static final int MAX_COLUMN_DISPLAY_WIDTH
Max column width when displaying a ResultSet.

See Also:
Constant Field Values
Constructor Detail

ResultSetFormatter

public ResultSetFormatter()
Method Detail

formatAndDisplay

public static void formatAndDisplay(java.sql.ResultSet rs,
                                    int fetchsize,
                                    Console console)
                             throws java.sql.SQLException
Format and display the given ResultSet on the console.

Parameters:
rs - the ResultSet to display
fetchsize - fetchisze value
console - console where the ResultSet will be displayed and he size of the result set)
Throws:
java.sql.SQLException - if an error occurs

appendSeparatorLine

private static void appendSeparatorLine(int columnCount,
                                        java.sql.ResultSetMetaData meta,
                                        Console console)
                                 throws java.sql.SQLException
Throws:
java.sql.SQLException

appendPad

private static void appendPad(java.lang.String text,
                              int size,
                              Console console)


Copyright © 2002, 2005 - ObjectWeb Consortium - All Rights Reserved.