|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.dbunit.database.AbstractDatabaseConnection
org.unitils.dbunit.util.DbUnitDatabaseConnection
public class DbUnitDatabaseConnection
Implementation of DBUnits IDatabaseConnection
interface. This implementation returns connections from
an underlying DataSource
. This implementation stores the Connection
that was retrieved last,
to enable closing it (or returing it to the pool) using closeJdbcConnection()
.
Constructor Summary | |
---|---|
DbUnitDatabaseConnection(DataSource dataSource,
String schemaName)
Creates a new instance that wraps the given DataSource |
Method Summary | |
---|---|
void |
close()
Method that is invoked by DBUnit when the connection is no longer needed. |
void |
closeJdbcConnection()
Closes the Connection that was last retrieved using the getConnection() method |
Connection |
getConnection()
Returns a Connection that can be used by DBUnit. |
protected Connection |
getNativeConnection(Connection connection)
|
String |
getSchema()
|
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 |
Constructor Detail |
---|
public DbUnitDatabaseConnection(DataSource dataSource, String schemaName)
DataSource
dataSource
- The data source, not nullschemaName
- The database schema, not nullMethod Detail |
---|
public void close() throws SQLException
SQLException
public String getSchema()
public Connection getConnection() throws SQLException
Connection
that can be used by DBUnit. A reference to the connection is kept, to be able
to 'close' it (return it to the connection pool) after the DBUnit operation finished. If an open connection
is already in use by DBUnit, this connection is returned
SQLException
protected Connection getNativeConnection(Connection connection) throws SQLException
connection
- The wrapper connection, not null
SQLException
public void closeJdbcConnection() throws SQLException
Connection
that was last retrieved using the getConnection()
method
SQLException
- When connection close fails
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |