Package org.dbunit.database
Class ScrollableResultSetTable
java.lang.Object
org.dbunit.dataset.AbstractTable
org.dbunit.database.AbstractResultSetTable
org.dbunit.database.ScrollableResultSetTable
- All Implemented Interfaces:
IResultSetTable,ITable
IResultSetTable implementation backed by a scrollable ResultSet cursor.- Since:
- Feb 17, 2002
- Version:
- $Revision$
- Author:
- Manuel Laflamme
-
Field Summary
Fields inherited from class org.dbunit.database.AbstractResultSetTable
_metaData, _resultSet -
Constructor Summary
ConstructorsConstructorDescriptionScrollableResultSetTable(String tableName, String selectStatement, IDatabaseConnection connection) Creates a table that runs the given select statement.ScrollableResultSetTable(ITableMetaData metaData, ResultSet resultSet) Creates a table wrapping the given, already-scrolled result set.ScrollableResultSetTable(ITableMetaData metaData, IDatabaseConnection connection) Creates a table that runs the default query for the given metadata and connection. -
Method Summary
Methods inherited from class org.dbunit.database.AbstractResultSetTable
close, createStatement, getTableMetaDataMethods inherited from class org.dbunit.dataset.AbstractTable
assertValidColumn, assertValidRowIndex, assertValidRowIndex, getColumnIndex
-
Constructor Details
-
ScrollableResultSetTable
public ScrollableResultSetTable(ITableMetaData metaData, ResultSet resultSet) throws SQLException, DataSetException Creates a table wrapping the given, already-scrolled result set.- Parameters:
metaData- the table's metadata.resultSet- the scrollable result set to wrap.- Throws:
SQLException- if the result set is forward-only or a database access error occurs.DataSetException- if the row count cannot be determined.
-
ScrollableResultSetTable
public ScrollableResultSetTable(ITableMetaData metaData, IDatabaseConnection connection) throws DataSetException, SQLException Creates a table that runs the default query for the given metadata and connection.- Parameters:
metaData- the table's metadata.connection- the database connection to query.- Throws:
DataSetException- if the row count cannot be determined.SQLException- if the result set is forward-only or a database access error occurs.
-
ScrollableResultSetTable
public ScrollableResultSetTable(String tableName, String selectStatement, IDatabaseConnection connection) throws DataSetException, SQLException Creates a table that runs the given select statement.- Parameters:
tableName- the table's name.selectStatement- the SQL select statement to run.connection- the database connection to query.- Throws:
DataSetException- if the row count cannot be determined.SQLException- if the result set is forward-only or a database access error occurs.
-
-
Method Details
-
getRowCount
public int getRowCount()Description copied from interface:ITableReturns this table row count.- Returns:
- this table row count.
-
getValue
Description copied from interface:ITableReturns this table value for the specified row and column.- Parameters:
row- The row index, starting with 0columnName- The name of the column- Returns:
- The value
- Throws:
DataSetException
-
toString
- Overrides:
toStringin classAbstractResultSetTable
-