org.dbunit.database
Class DatabaseConnection

java.lang.Object
  extended byorg.dbunit.database.AbstractDatabaseConnection
      extended byorg.dbunit.database.DatabaseConnection
All Implemented Interfaces:
IDatabaseConnection
Direct Known Subclasses:
Db2Connection, MsSqlConnection, MySqlConnection, OracleConnection

public class DatabaseConnection
extends AbstractDatabaseConnection
implements IDatabaseConnection

This class adapts a JDBC Connection to a IDatabaseConnection.

Since:
Feb 21, 2002
Version:
$Revision: 1.11 $
Author:
Manuel Laflamme

Constructor Summary
DatabaseConnection(java.sql.Connection connection)
          Creates a new DatabaseConnection.
DatabaseConnection(java.sql.Connection connection, java.lang.String schema)
          Creates a new DatabaseConnection.
 
Method Summary
 void close()
          Close this connection.
 java.sql.Connection getConnection()
          Returns a JDBC database connection.
 java.lang.String getSchema()
          Returns the database schema name.
 
Methods inherited from class org.dbunit.database.AbstractDatabaseConnection
createDataSet, createDataSet, createQueryTable, getConfig, getRowCount, getRowCount, 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
createDataSet, createDataSet, createQueryTable, getConfig, getRowCount, getRowCount, getStatementFactory
 

Constructor Detail

DatabaseConnection

public DatabaseConnection(java.sql.Connection connection,
                          java.lang.String schema)
Creates a new DatabaseConnection.

Parameters:
connection - the adapted JDBC connection
schema - the database schema

DatabaseConnection

public DatabaseConnection(java.sql.Connection connection)
Creates a new DatabaseConnection.

Parameters:
connection - the adapted JDBC connection
Method Detail

getConnection

public java.sql.Connection getConnection()
                                  throws java.sql.SQLException
Description copied from interface: IDatabaseConnection
Returns a JDBC database connection.

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

getSchema

public java.lang.String getSchema()
Description copied from interface: IDatabaseConnection
Returns the database schema name.

Specified by:
getSchema in interface IDatabaseConnection

close

public void close()
           throws java.sql.SQLException
Description copied from interface: IDatabaseConnection
Close this connection.

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


Copyright © 2002-2004 DbUnit.org. All Rights Reserved.