cds.sql
Class DisplayResultTable

java.lang.Object
  extended bycds.sql.DisplayResult
      extended bycds.sql.DisplayResultTable

public class DisplayResultTable
extends DisplayResult

Display a result set as an ascii table

Version:
1.0 June 2003 1.1 July 2003 (SJ) : ajout des methodes display(...,nbToDisplay...) et display(...msg...)
Author:
Marc Wenger/CDS, Sylvaine Jaehn

Constructor Summary
DisplayResultTable()
          Constructor
 
Method Summary
private  java.lang.String buildLine(int[] w, java.lang.String[] str)
          Build a result line from an array of width and an array of strings.
 void display(java.io.PrintStream p, ResultSetBean rs, boolean out)
          MOD-BB 08-01-04 Affiche un ResultSetBean.
 void display(java.io.PrintStream p, ResultSetBean rs, int nbToDisplay, boolean out)
          MOD-BB 08-01-04 Affiche un ResultSetBean.
 void display(java.io.PrintStream prt, java.sql.ResultSet result, boolean out)
          Display the result set in table format
 void display(java.io.PrintStream prt, java.sql.ResultSet result, int nbToDisplay, boolean out)
          Display the result set in table format
 void display(java.io.PrintStream prt, java.lang.String msg, boolean out)
          Affichage d'un message sous forme d'une chaine de caracteres
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DisplayResultTable

public DisplayResultTable()
Constructor

Method Detail

display

public void display(java.io.PrintStream prt,
                    java.sql.ResultSet result,
                    boolean out)
Display the result set in table format

Specified by:
display in class DisplayResult
Parameters:
prt - output print stream
result - Result Set to display
out - false if the output should not be done

display

public void display(java.io.PrintStream prt,
                    java.sql.ResultSet result,
                    int nbToDisplay,
                    boolean out)
Display the result set in table format

Specified by:
display in class DisplayResult
Parameters:
prt - output print stream
result - Result Set to display
nbToDisplay - number of lines to display
out - false if the output should not be done

buildLine

private java.lang.String buildLine(int[] w,
                                   java.lang.String[] str)
Build a result line from an array of width and an array of strings. The resulting string may contain several lines if items contain also.

Parameters:
w - array of widths (expressed in number of chars)
str - array of strings to display
Returns:
The whole line

display

public void display(java.io.PrintStream prt,
                    java.lang.String msg,
                    boolean out)
Affichage d'un message sous forme d'une chaine de caracteres

Specified by:
display in class DisplayResult
Parameters:
prt - print stream
msg - message to display
out - false if the output should not occur

display

public void display(java.io.PrintStream p,
                    ResultSetBean rs,
                    boolean out)
Description copied from class: DisplayResult
MOD-BB 08-01-04 Affiche un ResultSetBean.

Specified by:
display in class DisplayResult
Parameters:
p - defines a printstream
rs - resultset to display
out - if false, no output will occur

display

public void display(java.io.PrintStream p,
                    ResultSetBean rs,
                    int nbToDisplay,
                    boolean out)
Description copied from class: DisplayResult
MOD-BB 08-01-04 Affiche un ResultSetBean.

Specified by:
display in class DisplayResult
Parameters:
p - defines a printstream
rs - resultset to display
nbToDisplay - number of lines to display
out - if false, no output will occur