Package org.dbunit.database
Class AbstractResultSetTable
java.lang.Object
org.dbunit.dataset.AbstractTable
org.dbunit.database.AbstractResultSetTable
- All Implemented Interfaces:
IResultSetTable,ITable
- Direct Known Subclasses:
ForwardOnlyResultSetTable,ScrollableResultSetTable
- Since:
- Apr 10, 2003
- Version:
- $Revision$
- Author:
- Manuel Laflamme
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ITableMetaDataThe metadata of this table.protected ResultSetThe result set backing this table's rows. -
Constructor Summary
ConstructorsModifierConstructorDescriptionAbstractResultSetTable(String tableName, String selectStatement, IDatabaseConnection connection) Creates a table from a table name, SQL statement, and connection.AbstractResultSetTable(String tableName, String selectStatement, IDatabaseConnection connection, boolean caseSensitiveTableNames) Creates a table from a table name, SQL statement, and connection.protectedAbstractResultSetTable(String tableName, String selectStatement, IDatabaseConnection connection, boolean caseSensitiveTableNames, int resultSetType) Creates a table from a table name, SQL, and connection using the given ResultSet type.AbstractResultSetTable(ITableMetaData metaData, ResultSet resultSet) Creates a table wrapping the given already-executed result set.AbstractResultSetTable(ITableMetaData metaData, IDatabaseConnection connection) Creates a table from a metadata descriptor and a connection, using a forward-only result set.protectedAbstractResultSetTable(ITableMetaData metaData, IDatabaseConnection connection, int resultSetType) Creates a table from a metadata descriptor and a connection using the given ResultSet type. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the underlying result set and releases its resources.protected StatementcreateStatement(IDatabaseConnection connection, int resultSetType) Creates aStatementwith the specified ResultSet type.Returns this table metadata.toString()Methods 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, getValue
-
Field Details
-
_metaData
The metadata of this table. -
_resultSet
The result set backing this table's rows.
-
-
Constructor Details
-
AbstractResultSetTable
public AbstractResultSetTable(ITableMetaData metaData, ResultSet resultSet) throws SQLException, DataSetException Creates a table wrapping the given already-executed result set.- Parameters:
metaData- the table metadata.resultSet- the result set backing this table's rows.- Throws:
SQLException- if statement creation or execution fails.DataSetException- if metadata retrieval fails.
-
AbstractResultSetTable
public AbstractResultSetTable(String tableName, String selectStatement, IDatabaseConnection connection) throws DataSetException, SQLException Creates a table from a table name, SQL statement, and connection.- Parameters:
tableName- the table name.selectStatement- the SQL select statement.connection- the database connection.- Throws:
DataSetException- if metadata retrieval fails.SQLException- if statement creation or execution fails.
-
AbstractResultSetTable
public AbstractResultSetTable(String tableName, String selectStatement, IDatabaseConnection connection, boolean caseSensitiveTableNames) throws DataSetException, SQLException Creates a table from a table name, SQL statement, and connection.- Parameters:
tableName- the table name.selectStatement- the SQL select statement.connection- the database connection.caseSensitiveTableNames- whether table names are case-sensitive.- Throws:
DataSetException- if metadata retrieval fails.SQLException- if statement creation or execution fails.- Since:
- 2.4.1
-
AbstractResultSetTable
protected AbstractResultSetTable(String tableName, String selectStatement, IDatabaseConnection connection, boolean caseSensitiveTableNames, int resultSetType) throws DataSetException, SQLException Creates a table from a table name, SQL, and connection using the given ResultSet type.- Parameters:
tableName- the table name.selectStatement- the SQL select statement.connection- the database connection.caseSensitiveTableNames- whether table names are case-sensitive.resultSetType- the JDBC ResultSet type (e.g.ResultSet.TYPE_SCROLL_INSENSITIVE).- Throws:
DataSetException- if metadata retrieval fails.SQLException- if statement creation or execution fails.
-
AbstractResultSetTable
public AbstractResultSetTable(ITableMetaData metaData, IDatabaseConnection connection) throws DataSetException, SQLException Creates a table from a metadata descriptor and a connection, using a forward-only result set.- Parameters:
metaData- the table metadata.connection- the database connection.- Throws:
DataSetException- if metadata retrieval fails.SQLException- if statement creation or execution fails.
-
AbstractResultSetTable
protected AbstractResultSetTable(ITableMetaData metaData, IDatabaseConnection connection, int resultSetType) throws DataSetException, SQLException Creates a table from a metadata descriptor and a connection using the given ResultSet type.- Parameters:
metaData- the table metadata.connection- the database connection.resultSetType- the JDBC ResultSet type (e.g.ResultSet.TYPE_SCROLL_INSENSITIVE).- Throws:
DataSetException- if metadata retrieval fails.SQLException- if statement creation or execution fails.
-
-
Method Details
-
createStatement
protected Statement createStatement(IDatabaseConnection connection, int resultSetType) throws SQLException Creates aStatementwith the specified ResultSet type. Subclasses use this to request scrollable result sets.- Parameters:
connection- the database connection.resultSetType- one ofResultSet.TYPE_FORWARD_ONLY,ResultSet.TYPE_SCROLL_INSENSITIVE, orResultSet.TYPE_SCROLL_SENSITIVE.- Returns:
- a configured statement.
- Throws:
SQLException- if statement creation fails.
-
getTableMetaData
Description copied from interface:ITableReturns this table metadata.- Specified by:
getTableMetaDatain interfaceITable- Returns:
- this table metadata.
-
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.
-
toString
-