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
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionAbstractResultSetTable(String tableName, String selectStatement, IDatabaseConnection connection) AbstractResultSetTable(String tableName, String selectStatement, IDatabaseConnection connection, boolean caseSensitiveTableNames) 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) AbstractResultSetTable(ITableMetaData metaData, IDatabaseConnection connection) 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()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
-
_resultSet
-
-
Constructor Details
-
AbstractResultSetTable
public AbstractResultSetTable(ITableMetaData metaData, ResultSet resultSet) throws SQLException, DataSetException - Throws:
SQLExceptionDataSetException
-
AbstractResultSetTable
public AbstractResultSetTable(String tableName, String selectStatement, IDatabaseConnection connection) throws DataSetException, SQLException - Throws:
DataSetExceptionSQLException
-
AbstractResultSetTable
public AbstractResultSetTable(String tableName, String selectStatement, IDatabaseConnection connection, boolean caseSensitiveTableNames) throws DataSetException, SQLException - 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 - Throws:
DataSetExceptionSQLException
-
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
-
close
- Specified by:
closein interfaceIResultSetTable- Throws:
DataSetException
-
toString
-