de.fesenmeyer.dbnormalizer.core.dbaccess
Class DataSet

java.lang.Object
  extended by de.fesenmeyer.dbnormalizer.core.dbaccess.DataSet

public class DataSet
extends Object

Class which provides saving a SQL-ResultSet in a matrix consisting of rows and columns. The resultset's column names are also saved.

Author:
DF

Field Summary
(package private)  int columnCount
          The number of columns.
(package private)  List<String> columnNames
          The column names.
(package private)  List<List<Object>> dataList
          A matrix of objects.
(package private)  int rowCount
          The number of rows.
 
Constructor Summary
DataSet(ResultSet rs)
          Class constructor specifying a ResultSet by argument rs.
 
Method Summary
 int getColumnCount()
          Gets the number of columns.
 List<String> getColumnNames()
          Gets the column names.
 List<Object> getRow(int index)
          Get the row at the specified index.
 int getRowCount()
          Gets the number of rows.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

columnNames

List<String> columnNames
The column names.


dataList

List<List<Object>> dataList
A matrix of objects.


columnCount

int columnCount
The number of columns.


rowCount

int rowCount
The number of rows.

Constructor Detail

DataSet

public DataSet(ResultSet rs)
        throws DBException
Class constructor specifying a ResultSet by argument rs. Fills this instance with the ResultSet's data.

Parameters:
rs - the ResultSet
Throws:
DBException - if a SQL-Exception occurs while reading the data
Method Detail

getRow

public List<Object> getRow(int index)
Get the row at the specified index.

Parameters:
index - the Index
Returns:
the row as a list of objects

getColumnNames

public List<String> getColumnNames()
Gets the column names.

Returns:
the column names as a list of strings

getColumnCount

public int getColumnCount()
Gets the number of columns.

Returns:
the number of columns

getRowCount

public int getRowCount()
Gets the number of rows.

Returns:
the number of rows