com.ora.jsp.sql
Class Row

java.lang.Object
  |
  +--com.ora.jsp.sql.Row

public class Row
extends java.lang.Object

This class represents a Row in a database query result. It contains a collection of Column objects. A Vector is used to hold the Column objects to preserve the column order in the base ResultSet.

Version:
1.0
Author:
Hans Bergsten, Gefion software

Field Summary
private  Column[] columns
           
 
Constructor Summary
Row(java.sql.ResultSet rs)
          Constructor.
 
Method Summary
 java.math.BigDecimal getBigDecimal(int columnIndex)
           
 java.math.BigDecimal getBigDecimal(java.lang.String columnName)
           
 boolean getBoolean(int columnIndex)
           
 boolean getBoolean(java.lang.String columnName)
           
 byte getByte(int columnIndex)
           
 byte getByte(java.lang.String columnName)
           
 byte[] getBytes(int columnIndex)
           
 byte[] getBytes(java.lang.String columnName)
           
 int getColumnCount()
          Returns the number of columns in this row.
 Column[] getColumns()
          Returns an array of the Columns in this row.
 java.sql.Date getDate(int columnIndex)
           
 java.sql.Date getDate(java.lang.String columnName)
           
 double getDouble(int columnIndex)
           
 double getDouble(java.lang.String columnName)
           
 float getFloat(int columnIndex)
           
 float getFloat(java.lang.String columnName)
           
private  int getIndex(java.lang.String columnName)
          Returns the index of the column with the specified name, ignoring case since column names must be unique anyway and some databases ignores the case used in the SELECT statement when they create the ResultSet.
 int getInt(int columnIndex)
           
 int getInt(java.lang.String columnName)
           
 long getLong(int columnIndex)
           
 long getLong(java.lang.String columnName)
           
 java.lang.Object getObject(int columnIndex)
           
 java.lang.Object getObject(java.lang.String columnName)
           
 short getShort(int columnIndex)
           
 short getShort(java.lang.String columnName)
           
 java.lang.String getString(int columnIndex)
           
 java.lang.String getString(java.lang.String columnName)
           
 java.sql.Time getTime(int columnIndex)
           
 java.sql.Time getTime(java.lang.String columnName)
           
 java.sql.Timestamp getTimestamp(int columnIndex)
           
 java.sql.Timestamp getTimestamp(java.lang.String columnName)
           
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

columns

private Column[] columns
Constructor Detail

Row

public Row(java.sql.ResultSet rs)
    throws java.sql.SQLException,
           UnsupportedTypeException
Constructor. Reads the columns from the current row in the specified ResultSet and creates the corresponding ColumnValue objects.
Parameters:
rs - the ResultSet
Throws:
SQLException, - if thrown by any JDBC API call
Method Detail

getColumnCount

public int getColumnCount()
Returns the number of columns in this row.

getColumns

public Column[] getColumns()
Returns an array of the Columns in this row.

getBigDecimal

public java.math.BigDecimal getBigDecimal(int columnIndex)
                                   throws NoSuchColumnException,
                                          UnsupportedConversionException

getBigDecimal

public java.math.BigDecimal getBigDecimal(java.lang.String columnName)
                                   throws NoSuchColumnException,
                                          UnsupportedConversionException

getBoolean

public boolean getBoolean(int columnIndex)
                   throws NoSuchColumnException,
                          UnsupportedConversionException

getBoolean

public boolean getBoolean(java.lang.String columnName)
                   throws NoSuchColumnException,
                          UnsupportedConversionException

getByte

public byte getByte(int columnIndex)
             throws NoSuchColumnException,
                    UnsupportedConversionException

getByte

public byte getByte(java.lang.String columnName)
             throws NoSuchColumnException,
                    UnsupportedConversionException

getBytes

public byte[] getBytes(int columnIndex)
                throws NoSuchColumnException,
                       UnsupportedConversionException

getBytes

public byte[] getBytes(java.lang.String columnName)
                throws NoSuchColumnException,
                       UnsupportedConversionException

getDate

public java.sql.Date getDate(int columnIndex)
                      throws NoSuchColumnException,
                             UnsupportedConversionException

getDate

public java.sql.Date getDate(java.lang.String columnName)
                      throws NoSuchColumnException,
                             UnsupportedConversionException

getDouble

public double getDouble(int columnIndex)
                 throws NoSuchColumnException,
                        UnsupportedConversionException

getDouble

public double getDouble(java.lang.String columnName)
                 throws NoSuchColumnException,
                        UnsupportedConversionException

getFloat

public float getFloat(int columnIndex)
               throws NoSuchColumnException,
                      UnsupportedConversionException

getFloat

public float getFloat(java.lang.String columnName)
               throws NoSuchColumnException,
                      UnsupportedConversionException

getInt

public int getInt(int columnIndex)
           throws NoSuchColumnException,
                  UnsupportedConversionException

getInt

public int getInt(java.lang.String columnName)
           throws NoSuchColumnException,
                  UnsupportedConversionException

getLong

public long getLong(int columnIndex)
             throws NoSuchColumnException,
                    UnsupportedConversionException

getLong

public long getLong(java.lang.String columnName)
             throws NoSuchColumnException,
                    UnsupportedConversionException

getObject

public java.lang.Object getObject(int columnIndex)
                           throws NoSuchColumnException,
                                  UnsupportedConversionException

getObject

public java.lang.Object getObject(java.lang.String columnName)
                           throws NoSuchColumnException,
                                  UnsupportedConversionException

getShort

public short getShort(int columnIndex)
               throws NoSuchColumnException,
                      UnsupportedConversionException

getShort

public short getShort(java.lang.String columnName)
               throws NoSuchColumnException,
                      UnsupportedConversionException

getString

public java.lang.String getString(int columnIndex)
                           throws NoSuchColumnException

getString

public java.lang.String getString(java.lang.String columnName)
                           throws NoSuchColumnException

getTime

public java.sql.Time getTime(int columnIndex)
                      throws NoSuchColumnException,
                             UnsupportedConversionException

getTime

public java.sql.Time getTime(java.lang.String columnName)
                      throws NoSuchColumnException,
                             UnsupportedConversionException

getTimestamp

public java.sql.Timestamp getTimestamp(int columnIndex)
                                throws NoSuchColumnException,
                                       UnsupportedConversionException

getTimestamp

public java.sql.Timestamp getTimestamp(java.lang.String columnName)
                                throws NoSuchColumnException,
                                       UnsupportedConversionException

getIndex

private int getIndex(java.lang.String columnName)
              throws NoSuchColumnException
Returns the index of the column with the specified name, ignoring case since column names must be unique anyway and some databases ignores the case used in the SELECT statement when they create the ResultSet.