org.dbunit.database
Class AbstractDatabaseConnection

java.lang.Object
  extended by org.dbunit.database.AbstractDatabaseConnection
All Implemented Interfaces:
IDatabaseConnection
Direct Known Subclasses:
DatabaseConnection, DatabaseDataSourceConnection

public abstract class AbstractDatabaseConnection
extends java.lang.Object
implements IDatabaseConnection

Since:
Mar 6, 2002
Version:
$Revision: 672 $
Author:
Manuel Laflamme

Constructor Summary
AbstractDatabaseConnection()
           
 
Method Summary
 IDataSet createDataSet()
          Creates a dataset corresponding to the entire database.
 IDataSet createDataSet(java.lang.String[] tableNames)
          Creates a dataset containing only the specified tables from the database.
 ITable createQueryTable(java.lang.String resultName, java.lang.String sql)
          Creates a table with the result of the specified SQL statement.
 DatabaseConfig getConfig()
          Returns this connection database configuration
 int getRowCount(java.lang.String tableName)
          Returns the specified table row count.
 int getRowCount(java.lang.String tableName, java.lang.String whereClause)
          Returns the specified table row count according specified where clause.
 IStatementFactory getStatementFactory()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.dbunit.database.IDatabaseConnection
close, getConnection, getSchema
 

Constructor Detail

AbstractDatabaseConnection

public AbstractDatabaseConnection()
Method Detail

createDataSet

public IDataSet createDataSet()
                       throws java.sql.SQLException
Description copied from interface: IDatabaseConnection
Creates a dataset corresponding to the entire database.

Specified by:
createDataSet in interface IDatabaseConnection
Throws:
java.sql.SQLException

createDataSet

public IDataSet createDataSet(java.lang.String[] tableNames)
                       throws java.sql.SQLException
Description copied from interface: IDatabaseConnection
Creates a dataset containing only the specified tables from the database.

Specified by:
createDataSet in interface IDatabaseConnection
Throws:
java.sql.SQLException

createQueryTable

public ITable createQueryTable(java.lang.String resultName,
                               java.lang.String sql)
                        throws DataSetException,
                               java.sql.SQLException
Description copied from interface: IDatabaseConnection
Creates a table with the result of the specified SQL statement. The table can be the result of a join statement.

Specified by:
createQueryTable in interface IDatabaseConnection
Parameters:
resultName - The name to be returned by ITableMetaData.getTableName().
sql - The SQL SELECT statement
Throws:
DataSetException
java.sql.SQLException

getRowCount

public int getRowCount(java.lang.String tableName)
                throws java.sql.SQLException
Description copied from interface: IDatabaseConnection
Returns the specified table row count.

Specified by:
getRowCount in interface IDatabaseConnection
Parameters:
tableName - the table name
Returns:
the row count
Throws:
java.sql.SQLException

getRowCount

public int getRowCount(java.lang.String tableName,
                       java.lang.String whereClause)
                throws java.sql.SQLException
Description copied from interface: IDatabaseConnection
Returns the specified table row count according specified where clause.

Specified by:
getRowCount in interface IDatabaseConnection
Parameters:
tableName - the table name
whereClause - the where clause
Returns:
the row count
Throws:
java.sql.SQLException

getConfig

public DatabaseConfig getConfig()
Description copied from interface: IDatabaseConnection
Returns this connection database configuration

Specified by:
getConfig in interface IDatabaseConnection

getStatementFactory

public IStatementFactory getStatementFactory()
Specified by:
getStatementFactory in interface IDatabaseConnection


Copyright © 2002-2008. All Rights Reserved.