org.ujac.util.table
Class ResultSetTable

java.lang.Object
  extended by org.ujac.util.table.BaseTable
      extended by org.ujac.util.table.ResultSetTable
All Implemented Interfaces:
Table, TableConstants, UjacTypes

public class ResultSetTable
extends BaseTable

Name: ResultSetTable
Description: A table implementation, serving data retrieved from a result set.

Author:
lauerc

Field Summary
 
Fields inherited from class org.ujac.util.table.BaseTable
columnMap, columns
 
Fields inherited from interface org.ujac.util.table.TableConstants
DEFAULT_DATE_FORMAT, DEFAULT_DOUBLE_FORMAT, DEFAULT_INTEGER_FORMAT, DEFAULT_TIME_FORMAT, DEFAULT_TIMESTAMP_FORMAT, ROW_TYPE_FOOTER, ROW_TYPE_GROUP, ROW_TYPE_GROUP_TITLE, ROW_TYPE_HEADER, ROW_TYPE_NORMAL
 
Fields inherited from interface org.ujac.util.UjacTypes
TYPE_BOOLEAN, TYPE_DATE, TYPE_DOUBLE, TYPE_FLOAT, TYPE_INT, TYPE_LONG, TYPE_NAME_BOOLEAN, TYPE_NAME_DATE, TYPE_NAME_DOUBLE, TYPE_NAME_FLOAT, TYPE_NAME_INT, TYPE_NAME_LONG, TYPE_NAME_OBJECT, TYPE_NAME_SHORT, TYPE_NAME_STRING, TYPE_NAME_TABLE, TYPE_NAME_TIME, TYPE_NAME_TIMESTAMP, TYPE_OBJECT, TYPE_SHORT, TYPE_STRING, TYPE_TABLE, TYPE_TIME, TYPE_TIMESTAMP
 
Constructor Summary
ResultSetTable(ResultSet resultSet)
          Constructs a DataTable instance with specific arguments.
ResultSetTable(ResultSet resultSet, FormatHelper formatHelper)
          Constructs a DataTable instance with specific arguments.
ResultSetTable(ResultSet resultSet, FormatHelper formatHelper, DataTypeMapper dataTypeMapper)
          Constructs a DataTable instance with no specific arguments.
 
Method Summary
 Table addBoolean(String name, boolean value)
          Adds a column of type boolean to the table and sets its initial value at the first row.
 Column addColumn(String name, int type)
          Adds a column to the table
 Column addColumn(String name, int type, LayoutHints layoutHints)
          Adds a column to the table
 Table addDate(String name, Date value)
          Adds a column of type Date to the table and sets its initial value at the first row.
 Table addDouble(String name, double value)
          Adds a column of type double to the table and sets its initial value at the first row.
 Table addFloat(String name, float value)
          Adds a column of type float to the table and sets its initial value at the first row.
 Table addInt(String name, int value)
          Adds a column of type int to the table and sets its initial value at the first row.
 Table addLong(String name, long value)
          Adds a column of type long to the table and sets its initial value at the first row.
 Row addRow()
          Adds a row to the table
 Row addRow(Row srcRow)
          Adds a row to the table
 Table addString(String name, String value)
          Adds a column of type String to the table and sets its initial value at the first row.
 Table addTime(String name, Date value)
          Adds a column of type Date to the table and sets its initial value at the first row.
 Table addTimestamp(String name, Date value)
          Adds a column of type Date to the table and sets its initial value at the first row.
protected  boolean checkNextRow()
          Checks, if the next row exists in the result set or not.
 boolean getBoolean(int rowIdx, int columnIdx)
          Gets the boolean value from the given row.
 boolean getBoolean(int rowIdx, String columnName)
          Gets the boolean value from the given row.
 Date getDate(int rowIdx, int columnIdx)
          Gets the Date value from the given row.
 Date getDate(int rowIdx, String columnName)
          Gets the Date value from the given row.
 double getDouble(int rowIdx, int columnIdx)
          Gets the double value from the given row.
 double getDouble(int rowIdx, String columnName)
          Gets the double value from the given row.
 float getFloat(int rowIdx, int columnIdx)
          Gets the float value from the given row.
 float getFloat(int rowIdx, String columnName)
          Gets the double value from the given row.
 Row getHeaderRow()
          Gets the header row.
 int getInt(int rowIdx, int columnIdx)
          Gets the integer value from the given row.
 int getInt(int rowIdx, String columnName)
          Gets the integer value from the given row.
 long getLong(int rowIdx, int columnIdx)
          Gets the long value from the given row.
 long getLong(int rowIdx, String columnName)
          Gets the long value from the given row.
 Object getObject(int rowIdx, int columnIdx)
          Gets the Object value from the given row at the given column.
 Object getObject(int rowIdx, String columnName)
          Gets the Object value from the given row at the given column.
 Row getRow(int rowIdx)
          Gets a row from the table
 int getRowCount()
          Gets the current number of rows.
 String getString(int rowIdx, int columnIdx)
          Gets the String value from the given row at the given column.
 String getString(int rowIdx, String columnName)
          Gets the String value from the given row at the given column.
 Date getTime(int rowIdx, int columnIdx)
          Gets the Time value from the given row.
 Date getTime(int rowIdx, String columnName)
          Gets the Time value from the given row.
 Date getTimestamp(int rowIdx, int columnIdx)
          Gets the Timestamp value from the given row.
 Date getTimestamp(int rowIdx, String columnName)
          Gets the Timestamp value from the given row.
 boolean isEmpty()
          Checks if the table is empty.
 Iterator iterator()
          Returns an iterator over the rows in this table in proper sequence.
 void removeRow(int rowIdx)
          Removes a row from the table
 void setBoolean(int rowIdx, int columnIdx, boolean value)
          Sets the boolean value at the given row.
 void setBoolean(int rowIdx, String columnName, boolean value)
          Sets the boolean value at the given row.
 void setColumnType(int columnIdx, int typeId)
          Changes the type of the given column.
 void setColumnType(String columnName, int typeId)
          Changes the type of the given column.
 void setDate(int rowIdx, int columnIdx, Date value)
          Sets the Date value at the given row.
 void setDate(int rowIdx, String columnName, Date value)
          Sets the Date value at the given row.
 void setDouble(int rowIdx, int columnIdx, double value)
          Sets the double value at the given row.
 void setDouble(int rowIdx, String columnName, double value)
          Sets the double value at the given row.
 void setFloat(int rowIdx, int columnIdx, float value)
          Sets the float value at the given row.
 void setFloat(int rowIdx, String columnName, float value)
          Sets the float value at the given row.
 void setInt(int rowIdx, int columnIdx, int value)
          Sets the integer value at the given row.
 void setInt(int rowIdx, String columnName, int value)
          Sets the integer value at the given row.
 void setLong(int rowIdx, int columnIdx, long value)
          Sets the long value at the given row.
 void setLong(int rowIdx, String columnName, long value)
          Sets the integer value at the given row.
 void setObject(int rowIdx, int columnIdx, Object value)
          Sets the Object value at the given row.
 void setObject(int rowIdx, String columnName, Object value)
          Sets the Object value at the given row.
 void setString(int rowIdx, int columnIdx, String value)
          Sets the String value at the given row.
 void setString(int rowIdx, String columnName, String value)
          Sets the String value at the given row.
 void setTime(int rowIdx, int columnIdx, Date value)
          Sets the Time value at the given row.
 void setTime(int rowIdx, String columnName, Date value)
          Sets the Time value at the given row.
 void setTimestamp(int rowIdx, int columnIdx, Date value)
          Sets the Timestamp value at the given row.
 void setTimestamp(int rowIdx, String columnName, Date value)
          Sets the Timestamp value at the given row.
 void sort(CompareItem[] compareColumns)
          Sorts the table according to the given compare item definitions.
 void sort(int columnIdx, int direction)
          Sorts the table according to the given column and direction.
 String toString()
          Converts the table to String.
 
Methods inherited from class org.ujac.util.table.BaseTable
addColumn, copyTable, getColumn, getColumn, getColumnCount, getColumnIndex, getDistinctValues, getDistinctValues, getFormatHelper, getTypeConverter, getVisibleColumns, getVisibleColumns, orderColumns, readData, renameColumn, setFormatHelper, setTypeConverter, writeData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ResultSetTable

public ResultSetTable(ResultSet resultSet)
               throws SQLException,
                      TableException
Constructs a DataTable instance with specific arguments.

Parameters:
resultSet - The result set to read.
Throws:
SQLException - If a database problem occured.
TableException - If a table problem occured.

ResultSetTable

public ResultSetTable(ResultSet resultSet,
                      FormatHelper formatHelper)
               throws SQLException,
                      TableException
Constructs a DataTable instance with specific arguments.

Parameters:
resultSet - The result set to read.
formatHelper - The format helper to use.
Throws:
SQLException - If a database problem occured.
TableException - If a table problem occured.

ResultSetTable

public ResultSetTable(ResultSet resultSet,
                      FormatHelper formatHelper,
                      DataTypeMapper dataTypeMapper)
               throws SQLException,
                      TableException
Constructs a DataTable instance with no specific arguments.

Parameters:
resultSet - The result set to read.
formatHelper - The format helper to use.
dataTypeMapper - The data type mapper to use.
Throws:
SQLException - If a database problem occured.
TableException - If a table problem occured.
Method Detail

addColumn

public Column addColumn(String name,
                        int type)
                 throws OperationNotSupportedException
Adds a column to the table

Specified by:
addColumn in interface Table
Overrides:
addColumn in class BaseTable
Parameters:
name - The column name.
type - The column type.
Returns:
The new column.
Throws:
OperationNotSupportedException - This method is not supported for this implementation.

addColumn

public Column addColumn(String name,
                        int type,
                        LayoutHints layoutHints)
                 throws OperationNotSupportedException
Adds a column to the table

Parameters:
name - The column name.
type - The column type.
layoutHints - The layout hints for the column.
Returns:
The new column.
Throws:
OperationNotSupportedException - In case the operation is not supported.

addString

public Table addString(String name,
                       String value)
                throws OperationNotSupportedException
Adds a column of type String to the table and sets its initial value at the first row.

Parameters:
name - The column name.
value - The initial value at the first row.
Returns:
A reference to this table.
Throws:
OperationNotSupportedException - This method is not supported for this implementation.

addInt

public Table addInt(String name,
                    int value)
             throws TableException
Adds a column of type int to the table and sets its initial value at the first row.

Parameters:
name - The column name.
value - The initial value at the first row.
Returns:
A reference to this table.
Throws:
TableException - This method is not supported for this implementation.

addLong

public Table addLong(String name,
                     long value)
              throws TableException
Adds a column of type long to the table and sets its initial value at the first row.

Parameters:
name - The column name.
value - The initial value at the first row.
Returns:
A reference to this table.
Throws:
TableException - This method is not supported for this implementation.

addFloat

public Table addFloat(String name,
                      float value)
               throws TableException
Adds a column of type float to the table and sets its initial value at the first row.

Parameters:
name - The column name.
value - The initial value at the first row.
Returns:
A reference to this table.
Throws:
TableException - This method is not supported for this implementation.

addDouble

public Table addDouble(String name,
                       double value)
                throws TableException
Adds a column of type double to the table and sets its initial value at the first row.

Parameters:
name - The column name.
value - The initial value at the first row.
Returns:
A reference to this table.
Throws:
TableException - This method is not supported for this implementation.

addBoolean

public Table addBoolean(String name,
                        boolean value)
                 throws TableException
Adds a column of type boolean to the table and sets its initial value at the first row.

Parameters:
name - The column name.
value - The initial value at the first row.
Returns:
A reference to this table.
Throws:
TableException - This method is not supported for this implementation.

addDate

public Table addDate(String name,
                     Date value)
              throws TableException
Adds a column of type Date to the table and sets its initial value at the first row.

Parameters:
name - The column name.
value - The initial value at the first row.
Returns:
A reference to this table.
Throws:
TableException - This method is not supported for this implementation.

addTime

public Table addTime(String name,
                     Date value)
              throws TableException
Adds a column of type Date to the table and sets its initial value at the first row.

Parameters:
name - The column name.
value - The initial value at the first row.
Returns:
A reference to this table.
Throws:
TableException - This method is not supported for this implementation.

addTimestamp

public Table addTimestamp(String name,
                          Date value)
                   throws TableException
Adds a column of type Date to the table and sets its initial value at the first row.

Parameters:
name - The column name.
value - The initial value at the first row.
Returns:
A reference to this table.
Throws:
TableException - This method is not supported for this implementation.

isEmpty

public boolean isEmpty()
Checks if the table is empty.

Returns:
true if the table has no rows, else false.

getRowCount

public int getRowCount()
Gets the current number of rows. Always return -1, because retrieving the number of result records is a problem for result sets.

Returns:
The number of rows.

addRow

public Row addRow()
           throws OperationNotSupportedException
Adds a row to the table

Returns:
The new row.
Throws:
OperationNotSupportedException - This method is not supported for this implementation.

addRow

public Row addRow(Row srcRow)
           throws OperationNotSupportedException
Description copied from interface: Table
Adds a row to the table

Parameters:
srcRow - The row to copy.
Returns:
The new row.
Throws:
OperationNotSupportedException - In case the operation is not supported.
See Also:
Table.addRow(org.ujac.util.table.Row)

getRow

public Row getRow(int rowIdx)
           throws RowNotDefinedException
Gets a row from the table

Parameters:
rowIdx - The index of the desired row.
Returns:
The new row.
Throws:
RowNotDefinedException - In case the requested row does not exist.

removeRow

public void removeRow(int rowIdx)
               throws OperationNotSupportedException
Removes a row from the table

Parameters:
rowIdx - The index of the row to remove.
Throws:
OperationNotSupportedException - This method is not supported for this implementation.

getHeaderRow

public Row getHeaderRow()
Gets the header row.

Returns:
The header row for the table.

iterator

public Iterator iterator()
Returns an iterator over the rows in this table in proper sequence.

Returns:
an iterator over the rows in this table in proper sequence.

getString

public String getString(int rowIdx,
                        int columnIdx)
                 throws RowNotDefinedException,
                        ColumnNotDefinedException,
                        TypeMismatchException
Gets the String value from the given row at the given column.

Parameters:
rowIdx - The index of the desired row.
columnIdx - The index of the desired column.
Returns:
The detected value.
Throws:
RowNotDefinedException - In case the requested row does not exist.
ColumnNotDefinedException - In case the requested column does not exist.
TypeMismatchException - In case the String conversion failed.

getString

public String getString(int rowIdx,
                        String columnName)
                 throws RowNotDefinedException,
                        ColumnNotDefinedException,
                        TypeMismatchException
Gets the String value from the given row at the given column.

Parameters:
rowIdx - The index of the desired row.
columnName - The name of the desired column.
Returns:
The detected value.
Throws:
RowNotDefinedException - In case the requested row does not exist.
ColumnNotDefinedException - In case the requested column does not exist.
TypeMismatchException - In case the String conversion failed.

setString

public void setString(int rowIdx,
                      int columnIdx,
                      String value)
               throws RowNotDefinedException,
                      ColumnNotDefinedException,
                      TypeMismatchException
Sets the String value at the given row.

Parameters:
rowIdx - The index of the desired row.
columnIdx - The index of the desired column.
value - The new value.
Throws:
RowNotDefinedException - In case the requested row does not exist.
ColumnNotDefinedException - In case the requested column does not exist.
TypeMismatchException - In case the String conversion failed.

setString

public void setString(int rowIdx,
                      String columnName,
                      String value)
               throws RowNotDefinedException,
                      ColumnNotDefinedException,
                      TypeMismatchException
Sets the String value at the given row.

Parameters:
rowIdx - The index of the desired row.
columnName - The name of the desired column.
value - The new value.
Throws:
RowNotDefinedException - In case the requested row does not exist.
ColumnNotDefinedException - In case the requested column does not exist.
TypeMismatchException - In case the String conversion failed.

getInt

public int getInt(int rowIdx,
                  int columnIdx)
           throws RowNotDefinedException,
                  ColumnNotDefinedException,
                  TypeMismatchException
Gets the integer value from the given row.

Parameters:
rowIdx - The index of the desired row.
columnIdx - The index of the desired column.
Returns:
The detected value.
Throws:
RowNotDefinedException - In case the requested row does not exist.
ColumnNotDefinedException - In case the requested column does not exist.
TypeMismatchException - In case the int conversion failed.

getInt

public int getInt(int rowIdx,
                  String columnName)
           throws RowNotDefinedException,
                  ColumnNotDefinedException,
                  TypeMismatchException
Gets the integer value from the given row.

Parameters:
rowIdx - The index of the desired row.
columnName - The index of the desired column.
Returns:
The detected value.
Throws:
RowNotDefinedException - In case the requested row does not exist.
ColumnNotDefinedException - In case the requested column does not exist.
TypeMismatchException - In case the int conversion failed.

setInt

public void setInt(int rowIdx,
                   int columnIdx,
                   int value)
            throws RowNotDefinedException,
                   ColumnNotDefinedException,
                   TypeMismatchException
Sets the integer value at the given row.

Parameters:
rowIdx - The index of the desired row.
columnIdx - The index of the desired column.
value - The new value.
Throws:
RowNotDefinedException - In case the requested row does not exist.
ColumnNotDefinedException - In case the requested column does not exist.
TypeMismatchException - In case the int conversion failed.

setInt

public void setInt(int rowIdx,
                   String columnName,
                   int value)
            throws RowNotDefinedException,
                   ColumnNotDefinedException,
                   TypeMismatchException
Sets the integer value at the given row.

Parameters:
rowIdx - The index of the desired row.
columnName - The name of the desired column.
value - The new value.
Throws:
RowNotDefinedException - In case the requested row does not exist.
ColumnNotDefinedException - In case the requested column does not exist.
TypeMismatchException - In case the int conversion failed.

getLong

public long getLong(int rowIdx,
                    int columnIdx)
             throws RowNotDefinedException,
                    ColumnNotDefinedException,
                    TypeMismatchException
Gets the long value from the given row.

Parameters:
rowIdx - The index of the desired row.
columnIdx - The index of the desired column.
Returns:
The detected value.
Throws:
RowNotDefinedException - In case the requested row does not exist.
ColumnNotDefinedException - In case the requested column does not exist.
TypeMismatchException - In case the long conversion failed.

getLong

public long getLong(int rowIdx,
                    String columnName)
             throws RowNotDefinedException,
                    ColumnNotDefinedException,
                    TypeMismatchException
Gets the long value from the given row.

Parameters:
rowIdx - The index of the desired row.
columnName - The name of the desired column.
Returns:
The detected value.
Throws:
RowNotDefinedException - In case the requested row does not exist.
ColumnNotDefinedException - In case the requested column does not exist.
TypeMismatchException - In case the long conversion failed.

setLong

public void setLong(int rowIdx,
                    int columnIdx,
                    long value)
             throws RowNotDefinedException,
                    ColumnNotDefinedException,
                    TypeMismatchException
Sets the long value at the given row.

Parameters:
rowIdx - The index of the desired row.
columnIdx - The index of the desired column.
value - The new value.
Throws:
RowNotDefinedException - In case the requested row does not exist.
ColumnNotDefinedException - In case the requested column does not exist.
TypeMismatchException - In case the long conversion failed.

setLong

public void setLong(int rowIdx,
                    String columnName,
                    long value)
             throws RowNotDefinedException,
                    ColumnNotDefinedException,
                    TypeMismatchException
Sets the integer value at the given row.

Parameters:
rowIdx - The index of the desired row.
columnName - The name of the desired column.
value - The new value.
Throws:
RowNotDefinedException - In case the requested row does not exist.
ColumnNotDefinedException - In case the requested column does not exist.
TypeMismatchException - In case the long conversion failed.

getFloat

public float getFloat(int rowIdx,
                      int columnIdx)
               throws RowNotDefinedException,
                      ColumnNotDefinedException,
                      TypeMismatchException
Gets the float value from the given row.

Parameters:
rowIdx - The index of the desired row.
columnIdx - The index of the desired column.
Returns:
The detected value.
Throws:
RowNotDefinedException - In case the requested row does not exist.
ColumnNotDefinedException - In case the requested column does not exist.
TypeMismatchException - In case the float conversion failed.

getFloat

public float getFloat(int rowIdx,
                      String columnName)
               throws RowNotDefinedException,
                      ColumnNotDefinedException,
                      TypeMismatchException
Gets the double value from the given row.

Parameters:
rowIdx - The index of the desired row.
columnName - The name of the desired column.
Returns:
The detected value.
Throws:
RowNotDefinedException - In case the requested row does not exist.
ColumnNotDefinedException - In case the requested column does not exist.
TypeMismatchException - In case the float conversion failed.

setFloat

public void setFloat(int rowIdx,
                     int columnIdx,
                     float value)
              throws RowNotDefinedException,
                     ColumnNotDefinedException,
                     TypeMismatchException
Sets the float value at the given row.

Parameters:
rowIdx - The index of the desired row.
columnIdx - The index of the desired column.
value - The new value.
Throws:
RowNotDefinedException - In case the requested row does not exist.
ColumnNotDefinedException - In case the requested column does not exist.
TypeMismatchException - In case the float conversion failed.

setFloat

public void setFloat(int rowIdx,
                     String columnName,
                     float value)
              throws RowNotDefinedException,
                     ColumnNotDefinedException,
                     TypeMismatchException
Sets the float value at the given row.

Parameters:
rowIdx - The index of the desired row.
columnName - The name of the desired column.
value - The new value.
Throws:
RowNotDefinedException - In case the requested row does not exist.
ColumnNotDefinedException - In case the requested column does not exist.
TypeMismatchException - In case the float conversion failed.

getDouble

public double getDouble(int rowIdx,
                        int columnIdx)
                 throws RowNotDefinedException,
                        ColumnNotDefinedException,
                        TypeMismatchException
Gets the double value from the given row.

Parameters:
rowIdx - The index of the desired row.
columnIdx - The index of the desired column.
Returns:
The detected value.
Throws:
RowNotDefinedException - In case the requested row does not exist.
ColumnNotDefinedException - In case the requested column does not exist.
TypeMismatchException - In case the double conversion failed.

getDouble

public double getDouble(int rowIdx,
                        String columnName)
                 throws RowNotDefinedException,
                        ColumnNotDefinedException,
                        TypeMismatchException
Gets the double value from the given row.

Parameters:
rowIdx - The index of the desired row.
columnName - The name of the desired column.
Returns:
The detected value.
Throws:
RowNotDefinedException - In case the requested row does not exist.
ColumnNotDefinedException - In case the requested column does not exist.
TypeMismatchException - In case the double conversion failed.

setDouble

public void setDouble(int rowIdx,
                      int columnIdx,
                      double value)
               throws RowNotDefinedException,
                      ColumnNotDefinedException,
                      TypeMismatchException
Sets the double value at the given row.

Parameters:
rowIdx - The index of the desired row.
columnIdx - The index of the desired column.
value - The new value.
Throws:
RowNotDefinedException - In case the requested row does not exist.
ColumnNotDefinedException - In case the requested column does not exist.
TypeMismatchException - In case the double conversion failed.

setDouble

public void setDouble(int rowIdx,
                      String columnName,
                      double value)
               throws RowNotDefinedException,
                      ColumnNotDefinedException,
                      TypeMismatchException
Sets the double value at the given row.

Parameters:
rowIdx - The index of the desired row.
columnName - The name of the desired column.
value - The new value.
Throws:
RowNotDefinedException - In case the requested row does not exist.
ColumnNotDefinedException - In case the requested column does not exist.
TypeMismatchException - In case the double conversion failed.

getBoolean

public boolean getBoolean(int rowIdx,
                          int columnIdx)
                   throws RowNotDefinedException,
                          ColumnNotDefinedException,
                          TypeMismatchException
Gets the boolean value from the given row.

Parameters:
rowIdx - The index of the desired row.
columnIdx - The index of the desired column.
Returns:
The detected value.
Throws:
RowNotDefinedException - In case the requested row does not exist.
ColumnNotDefinedException - In case the requested column does not exist.
TypeMismatchException - In case the boolean conversion failed.

getBoolean

public boolean getBoolean(int rowIdx,
                          String columnName)
                   throws RowNotDefinedException,
                          ColumnNotDefinedException,
                          TypeMismatchException
Gets the boolean value from the given row.

Parameters:
rowIdx - The index of the desired row.
columnName - The name of the desired column.
Returns:
The detected value.
Throws:
RowNotDefinedException - In case the requested row does not exist.
ColumnNotDefinedException - In case the requested column does not exist.
TypeMismatchException - In case the boolean conversion failed.

setBoolean

public void setBoolean(int rowIdx,
                       int columnIdx,
                       boolean value)
                throws RowNotDefinedException,
                       ColumnNotDefinedException,
                       TypeMismatchException
Sets the boolean value at the given row.

Parameters:
rowIdx - The index of the desired row.
columnIdx - The index of the desired column.
value - The new value.
Throws:
RowNotDefinedException - In case the requested row does not exist.
ColumnNotDefinedException - In case the requested column does not exist.
TypeMismatchException - In case the boolean conversion failed.

setBoolean

public void setBoolean(int rowIdx,
                       String columnName,
                       boolean value)
                throws RowNotDefinedException,
                       ColumnNotDefinedException,
                       TypeMismatchException
Sets the boolean value at the given row.

Parameters:
rowIdx - The index of the desired row.
columnName - The name of the desired column.
value - The new value.
Throws:
RowNotDefinedException - In case the requested row does not exist.
ColumnNotDefinedException - In case the requested column does not exist.
TypeMismatchException - In case the boolean conversion failed.

getDate

public Date getDate(int rowIdx,
                    int columnIdx)
             throws RowNotDefinedException,
                    ColumnNotDefinedException,
                    TypeMismatchException
Gets the Date value from the given row.

Parameters:
rowIdx - The index of the desired row.
columnIdx - The index of the desired column.
Returns:
The detected value.
Throws:
RowNotDefinedException - In case the requested row does not exist.
ColumnNotDefinedException - In case the requested column does not exist.
TypeMismatchException - In case the date conversion failed.

getDate

public Date getDate(int rowIdx,
                    String columnName)
             throws RowNotDefinedException,
                    ColumnNotDefinedException,
                    TypeMismatchException
Gets the Date value from the given row.

Parameters:
rowIdx - The index of the desired row.
columnName - The name of the desired column.
Returns:
The detected value.
Throws:
RowNotDefinedException - In case the requested row does not exist.
ColumnNotDefinedException - In case the requested column does not exist.
TypeMismatchException - In case the date conversion failed.

setDate

public void setDate(int rowIdx,
                    int columnIdx,
                    Date value)
             throws RowNotDefinedException,
                    ColumnNotDefinedException,
                    TypeMismatchException
Sets the Date value at the given row.

Parameters:
rowIdx - The index of the desired row.
columnIdx - The index of the desired column.
value - The new value.
Throws:
RowNotDefinedException - In case the requested row does not exist.
ColumnNotDefinedException - In case the requested column does not exist.
TypeMismatchException - In case the date conversion failed.

setDate

public void setDate(int rowIdx,
                    String columnName,
                    Date value)
             throws RowNotDefinedException,
                    ColumnNotDefinedException,
                    TypeMismatchException
Sets the Date value at the given row.

Parameters:
rowIdx - The index of the desired row.
columnName - The name of the desired column.
value - The new value.
Throws:
RowNotDefinedException - In case the requested row does not exist.
ColumnNotDefinedException - In case the requested column does not exist.
TypeMismatchException - In case the date conversion failed.

getTime

public Date getTime(int rowIdx,
                    int columnIdx)
             throws RowNotDefinedException,
                    ColumnNotDefinedException,
                    TypeMismatchException
Gets the Time value from the given row.

Parameters:
rowIdx - The index of the desired row.
columnIdx - The index of the desired column.
Returns:
The detected value.
Throws:
RowNotDefinedException - In case the requested row does not exist.
ColumnNotDefinedException - In case the requested column does not exist.
TypeMismatchException - In case the date conversion failed.

getTime

public Date getTime(int rowIdx,
                    String columnName)
             throws RowNotDefinedException,
                    ColumnNotDefinedException,
                    TypeMismatchException
Gets the Time value from the given row.

Parameters:
rowIdx - The index of the desired row.
columnName - The name of the desired column.
Returns:
The detected value.
Throws:
RowNotDefinedException - In case the requested row does not exist.
ColumnNotDefinedException - In case the requested column does not exist.
TypeMismatchException - In case the time conversion failed.

setTime

public void setTime(int rowIdx,
                    int columnIdx,
                    Date value)
             throws RowNotDefinedException,
                    ColumnNotDefinedException,
                    TypeMismatchException
Sets the Time value at the given row.

Parameters:
rowIdx - The index of the desired row.
columnIdx - The index of the desired column.
value - The new value.
Throws:
RowNotDefinedException - In case the requested row does not exist.
ColumnNotDefinedException - In case the requested column does not exist.
TypeMismatchException - In case the time conversion failed.

setTime

public void setTime(int rowIdx,
                    String columnName,
                    Date value)
             throws RowNotDefinedException,
                    ColumnNotDefinedException,
                    TypeMismatchException
Sets the Time value at the given row.

Parameters:
rowIdx - The index of the desired row.
columnName - The name of the desired column.
value - The new value.
Throws:
RowNotDefinedException - In case the requested row does not exist.
ColumnNotDefinedException - In case the requested column does not exist.
TypeMismatchException - In case the time conversion failed.

getTimestamp

public Date getTimestamp(int rowIdx,
                         int columnIdx)
                  throws RowNotDefinedException,
                         ColumnNotDefinedException,
                         TypeMismatchException
Gets the Timestamp value from the given row.

Parameters:
rowIdx - The index of the desired row.
columnIdx - The index of the desired column.
Returns:
The detected value.
Throws:
RowNotDefinedException - In case the requested row does not exist.
ColumnNotDefinedException - In case the requested column does not exist.
TypeMismatchException - In case the timestamp conversion failed.

getTimestamp

public Date getTimestamp(int rowIdx,
                         String columnName)
                  throws RowNotDefinedException,
                         ColumnNotDefinedException,
                         TypeMismatchException
Gets the Timestamp value from the given row.

Parameters:
rowIdx - The index of the desired row.
columnName - The name of the desired column.
Returns:
The detected value.
Throws:
RowNotDefinedException - In case the requested row does not exist.
ColumnNotDefinedException - In case the requested column does not exist.
TypeMismatchException - In case the timestamp conversion failed.

setTimestamp

public void setTimestamp(int rowIdx,
                         int columnIdx,
                         Date value)
                  throws RowNotDefinedException,
                         ColumnNotDefinedException,
                         TypeMismatchException
Sets the Timestamp value at the given row.

Parameters:
rowIdx - The index of the desired row.
columnIdx - The index of the desired column.
value - The new value.
Throws:
RowNotDefinedException - In case the requested row does not exist.
ColumnNotDefinedException - In case the requested column does not exist.
TypeMismatchException - In case the timestamp conversion failed.

setTimestamp

public void setTimestamp(int rowIdx,
                         String columnName,
                         Date value)
                  throws RowNotDefinedException,
                         ColumnNotDefinedException,
                         TypeMismatchException
Sets the Timestamp value at the given row.

Parameters:
rowIdx - The index of the desired row.
columnName - The name of the desired column.
value - The new value.
Throws:
RowNotDefinedException - In case the requested row does not exist.
ColumnNotDefinedException - In case the requested column does not exist.
TypeMismatchException - In case the timestamp conversion failed.

getObject

public Object getObject(int rowIdx,
                        int columnIdx)
                 throws RowNotDefinedException,
                        ColumnNotDefinedException
Gets the Object value from the given row at the given column.

Parameters:
rowIdx - The index of the desired row.
columnIdx - The index of the desired column.
Returns:
The detected value.
Throws:
RowNotDefinedException - In case the requested row does not exist.
ColumnNotDefinedException - In case the requested column does not exist.

getObject

public Object getObject(int rowIdx,
                        String columnName)
                 throws RowNotDefinedException,
                        ColumnNotDefinedException
Gets the Object value from the given row at the given column.

Parameters:
rowIdx - The index of the desired row.
columnName - The index of the desired column.
Returns:
The detected value.
Throws:
RowNotDefinedException - In case the requested row does not exist.
ColumnNotDefinedException - In case the requested column does not exist.

setObject

public void setObject(int rowIdx,
                      int columnIdx,
                      Object value)
               throws RowNotDefinedException,
                      ColumnNotDefinedException,
                      TypeMismatchException
Sets the Object value at the given row.

Parameters:
rowIdx - The index of the desired row.
columnIdx - The index of the desired column.
value - The new value.
Throws:
RowNotDefinedException - In case the requested row does not exist.
ColumnNotDefinedException - In case the requested column does not exist.
TypeMismatchException - In case the object conversion failed.

setObject

public void setObject(int rowIdx,
                      String columnName,
                      Object value)
               throws RowNotDefinedException,
                      ColumnNotDefinedException,
                      TypeMismatchException
Sets the Object value at the given row.

Parameters:
rowIdx - The index of the desired row.
columnName - The name of the desired column.
value - The new value.
Throws:
RowNotDefinedException - In case the requested row does not exist.
ColumnNotDefinedException - In case the requested column does not exist.
TypeMismatchException - In case the object conversion failed.

checkNextRow

protected boolean checkNextRow()
Checks, if the next row exists in the result set or not.

Returns:
true if the database cursor has been moved to the next row successfuly, else false.

toString

public String toString()
Converts the table to String.

Overrides:
toString in class Object
Returns:
the textual representation of the table.

sort

public void sort(CompareItem[] compareColumns)
          throws OperationNotSupportedException
Sorts the table according to the given compare item definitions.

Parameters:
compareColumns - The column definition for the sort process.
Throws:
OperationNotSupportedException - In case the operation is not supported.

sort

public void sort(int columnIdx,
                 int direction)
          throws OperationNotSupportedException
Sorts the table according to the given column and direction.

Parameters:
columnIdx - The column to sort by.
direction - The sort directon.
Throws:
OperationNotSupportedException - In case the operation is not supported.

setColumnType

public void setColumnType(int columnIdx,
                          int typeId)
                   throws ColumnNotDefinedException,
                          TypeConverterException
Changes the type of the given column.

Parameters:
columnIdx - The index of the column which has been changed.
typeId - The new column type ID.
Throws:
ColumnNotDefinedException - In case the desired column does not exist.
TypeConverterException - In case the object conversion failed.

setColumnType

public void setColumnType(String columnName,
                          int typeId)
                   throws ColumnNotDefinedException,
                          TypeConverterException
Changes the type of the given column.

Parameters:
columnName - The name of the column which has been changed.
typeId - The new column type ID.
Throws:
ColumnNotDefinedException - In case the desired column does not exist.
TypeConverterException - In case the object conversion failed.


Copyright © 2003-2004 UJAC.org. All Rights Reserved.