com.billpringle.utils.wrputils
Class WrpResultSetRow

java.lang.Object
  extended by com.billpringle.utils.wrputils.WrpResultSetRow

public class WrpResultSetRow
extends java.lang.Object

This class encapsulates a record within a ResultSet. It can be used with WrpResultSetRow to create a JTable.

Creative Commons License Creative Commons License Symbols Unless noted otherwise, all materials available for download from my site are copyrighted by Bill Pringle, and are licensed under a Creative Commons License.

Author:
Bill Pringle

Field Summary
 java.lang.String[] colNames
          names of columns
 java.lang.String[] colTypes
          data types of columns
 java.lang.String[] colValues
          vector for columns
 int ncols
          number of columns
 WrpResultSetVector vec
          parent result set vector
 
Constructor Summary
WrpResultSetRow(WrpResultSetVector vec)
          Normal constructor.
 
Method Summary
private  void buildColumns()
          Extract the columns for this record and convert to an array of strings.
 java.lang.String[] getColNames()
           
 java.lang.String getColString(int ndx)
          Get the column value as a string
 java.lang.String[] getColTypes()
           
 java.lang.String[] getColValues()
           
 int getNcols()
           
 WrpResultSetVector getVec()
           
 void setColNames(java.lang.String[] colNames)
           
 void setColTypes(java.lang.String[] colTypes)
           
 void setColValues(java.lang.String[] colValues)
           
 void setNcols(int ncols)
           
 void setVec(WrpResultSetVector vec)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

vec

public WrpResultSetVector vec
parent result set vector


ncols

public int ncols
number of columns


colNames

public java.lang.String[] colNames
names of columns


colTypes

public java.lang.String[] colTypes
data types of columns


colValues

public java.lang.String[] colValues
vector for columns

Constructor Detail

WrpResultSetRow

public WrpResultSetRow(WrpResultSetVector vec)
                throws java.sql.SQLException
Normal constructor. The parent vector will include this object

Parameters:
vec - parent vector
Throws:
java.sql.SQLException
Method Detail

buildColumns

private void buildColumns()
                   throws java.sql.SQLException
Extract the columns for this record and convert to an array of strings. The index for result strings start with 1, not 0.

Throws:
java.sql.SQLException

getColString

public java.lang.String getColString(int ndx)
Get the column value as a string

Parameters:
ndx - index of column
Returns:
column value as a string

getVec

public WrpResultSetVector getVec()
Returns:
the vec

setVec

public void setVec(WrpResultSetVector vec)
Parameters:
vec - the vec to set

getNcols

public int getNcols()
Returns:
the ncols

setNcols

public void setNcols(int ncols)
Parameters:
ncols - the ncols to set

getColNames

public java.lang.String[] getColNames()
Returns:
the colNames

setColNames

public void setColNames(java.lang.String[] colNames)
Parameters:
colNames - the colNames to set

getColTypes

public java.lang.String[] getColTypes()
Returns:
the colTypes

setColTypes

public void setColTypes(java.lang.String[] colTypes)
Parameters:
colTypes - the colTypes to set

getColValues

public java.lang.String[] getColValues()
Returns:
the colValues

setColValues

public void setColValues(java.lang.String[] colValues)
Parameters:
colValues - the colValues to set