Package org.dbunit.database
Class CachedResultSetTable
java.lang.Object
org.dbunit.dataset.AbstractTable
org.dbunit.dataset.DefaultTable
org.dbunit.dataset.CachedTable
org.dbunit.database.CachedResultSetTable
- All Implemented Interfaces:
IResultSetTable,ITable
IResultSetTable that eagerly loads and caches an entire ResultSet in memory.- Since:
- Feb 20, 2002
- Version:
- $Revision$
- Author:
- Manuel Laflamme
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a table that eagerly loads and caches all rows of the given table, then closes it.CachedResultSetTable(ITableMetaData metaData, ResultSet resultSet) Deprecated.CachedResultSetTable(ITableMetaData metaData, IDatabaseConnection connection) Deprecated.since 2.4.4 prefer direct usage ofForwardOnlyResultSetTable(ITableMetaData, IDatabaseConnection)and then invokeCachedResultSetTable(IResultSetTable) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the underlying result set and releases its resources.Methods inherited from class org.dbunit.dataset.DefaultTable
addRow, addRow, addTableRows, getRowCount, getTableMetaData, getValue, setValue, toStringMethods inherited from class org.dbunit.dataset.AbstractTable
assertValidColumn, assertValidRowIndex, assertValidRowIndex, getColumnIndexMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.dbunit.dataset.ITable
getRowCount, getTableMetaData, getValue
-
Constructor Details
-
CachedResultSetTable
public CachedResultSetTable(ITableMetaData metaData, ResultSet resultSet) throws SQLException, DataSetException Deprecated.since 2.3.0 prefer direct usage ofForwardOnlyResultSetTable(ITableMetaData, ResultSet)and then invokeCachedResultSetTable(IResultSetTable)- Parameters:
metaData- the table metadata.resultSet- the result set to load into memory.- Throws:
SQLException- if reading the result set fails.DataSetException- if metadata retrieval fails.
-
CachedResultSetTable
public CachedResultSetTable(ITableMetaData metaData, IDatabaseConnection connection) throws SQLException, DataSetException Deprecated.since 2.4.4 prefer direct usage ofForwardOnlyResultSetTable(ITableMetaData, IDatabaseConnection)and then invokeCachedResultSetTable(IResultSetTable)- Parameters:
metaData- the table metadata.connection- the database connection to query.- Throws:
SQLException- if executing the query fails.DataSetException- if metadata retrieval fails.
-
CachedResultSetTable
Creates a table that eagerly loads and caches all rows of the given table, then closes it.- Parameters:
table- the source table to load into memory.- Throws:
DataSetException- if loading the rows fails.SQLException- if reading the underlying result set fails.
-
-
Method Details
-
close
Description copied from interface:IResultSetTableCloses the underlying result set and releases its resources.- Specified by:
closein interfaceIResultSetTable- Throws:
DataSetException- if closing the result set fails.
-
ForwardOnlyResultSetTable(ITableMetaData, ResultSet)and then invokeCachedResultSetTable(IResultSetTable)