Package org.dbunit.database
Class AbstractDatabaseConnection
java.lang.Object
org.dbunit.database.AbstractDatabaseConnection
- All Implemented Interfaces:
IDatabaseConnection
- Direct Known Subclasses:
DatabaseConnection,DatabaseDataSourceConnection
- Since:
- Mar 6, 2002
- Version:
- $Revision$
- Author:
- Manuel Laflamme
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreates a dataset corresponding to the entire database.createDataSet(String[] tableNames) Creates a dataset containing only the specified tables from the database.createQueryTable(String resultName, String sql) Creates a table with the result of the specified SQL statement.createTable(String tableName) Creates a table with the result of aselect * from tableNameSQL statement.createTable(String resultName, PreparedStatement preparedStatement) Creates a table using the given PreparedStatement to retrieve a ResultSet.Returns this connection database configurationintgetRowCount(String tableName) Returns the specified table row count.intgetRowCount(String tableName, String whereClause) Returns the specified table row count according specified where clause.Deprecated.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.dbunit.database.IDatabaseConnection
close, getConnection, getSchema
-
Constructor Details
-
AbstractDatabaseConnection
public AbstractDatabaseConnection()
-
-
Method Details
-
createDataSet
Description copied from interface:IDatabaseConnectionCreates a dataset corresponding to the entire database.- Specified by:
createDataSetin interfaceIDatabaseConnection- Throws:
SQLException
-
createDataSet
Description copied from interface:IDatabaseConnectionCreates a dataset containing only the specified tables from the database.- Specified by:
createDataSetin interfaceIDatabaseConnection- Parameters:
tableNames- The tables for which a dataset shall be created- Returns:
- The new dataset
- Throws:
DataSetExceptionSQLException
-
createQueryTable
Description copied from interface:IDatabaseConnectionCreates a table with the result of the specified SQL statement. The table can be the result of a join statement.- Specified by:
createQueryTablein interfaceIDatabaseConnection- Parameters:
resultName- The name to be returned byITableMetaData.getTableName().sql- The SQLSELECTstatement- Returns:
- The new table
- Throws:
DataSetExceptionSQLException
-
createTable
public ITable createTable(String resultName, PreparedStatement preparedStatement) throws DataSetException, SQLException Description copied from interface:IDatabaseConnectionCreates a table using the given PreparedStatement to retrieve a ResultSet.- Specified by:
createTablein interfaceIDatabaseConnection- Parameters:
resultName- The name to be returned byITableMetaData.getTableName().preparedStatement- The statement to be executed as query- Returns:
- The new table
- Throws:
DataSetExceptionSQLException
-
createTable
Description copied from interface:IDatabaseConnectionCreates a table with the result of aselect * from tableNameSQL statement.- Specified by:
createTablein interfaceIDatabaseConnection- Parameters:
tableName- The name of the database table to be queried which is also returned byITableMetaData.getTableName().- Throws:
DataSetExceptionSQLException
-
getRowCount
Description copied from interface:IDatabaseConnectionReturns the specified table row count.- Specified by:
getRowCountin interfaceIDatabaseConnection- Parameters:
tableName- the table name- Returns:
- the row count
- Throws:
SQLException
-
getRowCount
Description copied from interface:IDatabaseConnectionReturns the specified table row count according specified where clause.- Specified by:
getRowCountin interfaceIDatabaseConnection- Parameters:
tableName- the table namewhereClause- the where clause- Returns:
- the row count
- Throws:
SQLException
-
getConfig
Description copied from interface:IDatabaseConnectionReturns this connection database configuration- Specified by:
getConfigin interfaceIDatabaseConnection
-
getStatementFactory
Deprecated.UsegetConfig()- Specified by:
getStatementFactoryin interfaceIDatabaseConnection
-
toString
-
getConfig()