com.billpringle.utils
Class WrpResultSetVector

java.lang.Object
  extended by com.billpringle.utils.WrpResultSetVector

public class WrpResultSetVector
extends java.lang.Object

This class encapsulates a ResultSet. The class can be used to build a JTable for the record set. The class contains a Vector of type WrpResultSetVector.

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
 int[] colScroll
          columns to display in scroll view
 java.lang.String[] colTypes
          names of column types
 java.sql.ResultSet resultSet
          result set
 java.util.Vector<WrpResultSetRow> rows
          rows of result set
 
Constructor Summary
WrpResultSetVector(java.sql.ResultSet rs)
          Constructor for result set.
 
Method Summary
private  void buildColNames()
          Build a String array with column names.
private  void buildRows()
          Build Vector of row elements
 java.lang.String[] getColNames()
           
 int[] getColScroll()
           
 java.lang.String[] getColTypes()
           
 java.sql.ResultSet getResultSet()
           
 WrpResultSetRow getRow(int ndx)
          Get the corresponding row from the result set
 java.util.Vector<WrpResultSetRow> getRows()
           
 void setColNames(java.lang.String[] colNames)
           
 void setColScroll(int[] colScroll)
           
 void setColTypes(java.lang.String[] colTypes)
           
 void setResultSet(java.sql.ResultSet resultSet)
           
 void setRows(java.util.Vector<WrpResultSetRow> rows)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

resultSet

public java.sql.ResultSet resultSet
result set


colNames

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


colTypes

public java.lang.String[] colTypes
names of column types


colScroll

public int[] colScroll
columns to display in scroll view


rows

public java.util.Vector<WrpResultSetRow> rows
rows of result set

Constructor Detail

WrpResultSetVector

public WrpResultSetVector(java.sql.ResultSet rs)
                   throws java.sql.SQLException
Constructor for result set. This is the normal constructor for this class. It will build column names and rows from the result set.

Parameters:
rs - the ResultSet to encapsulate
Throws:
java.sql.SQLException
Method Detail

buildColNames

private void buildColNames()
                    throws java.sql.SQLException
Build a String array with column names.

Throws:
java.sql.SQLException

buildRows

private void buildRows()
                throws java.sql.SQLException
Build Vector of row elements

Throws:
java.sql.SQLException

getRow

public WrpResultSetRow getRow(int ndx)
Get the corresponding row from the result set

Parameters:
ndx - index of row
Returns:
the requested row

getResultSet

public java.sql.ResultSet getResultSet()
Returns:
the resultSet

setResultSet

public void setResultSet(java.sql.ResultSet resultSet)
Parameters:
resultSet - the resultSet 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

getColScroll

public int[] getColScroll()
Returns:
the colScroll

setColScroll

public void setColScroll(int[] colScroll)
Parameters:
colScroll - the colScroll to set

getRows

public java.util.Vector<WrpResultSetRow> getRows()
Returns:
the rows

setRows

public void setRows(java.util.Vector<WrpResultSetRow> rows)
Parameters:
rows - the rows to set