public class DatabaseConnection extends AbstractDatabaseConnection implements IDatabaseConnection
Connection to a
IDatabaseConnection.| Constructor and Description |
|---|
DatabaseConnection(Connection connection)
Creates a new
DatabaseConnection. |
DatabaseConnection(Connection connection,
String schema)
Creates a new
DatabaseConnection using a specific schema. |
DatabaseConnection(Connection connection,
String schema,
boolean validate)
Creates a new
DatabaseConnection using a specific schema. |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close this connection.
|
Connection |
getConnection()
Returns a JDBC database connection.
|
String |
getSchema()
Returns the database schema name.
|
String |
toString() |
createDataSet, createDataSet, createQueryTable, createTable, createTable, getConfig, getRowCount, getRowCount, getStatementFactoryclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcreateDataSet, createDataSet, createQueryTable, createTable, createTable, getConfig, getRowCount, getRowCount, getStatementFactorypublic DatabaseConnection(Connection connection) throws DatabaseUnitException
DatabaseConnection.connection - the adapted JDBC connectionDatabaseUnitExceptionpublic DatabaseConnection(Connection connection, String schema) throws DatabaseUnitException
DatabaseConnection using a specific schema.connection - the adapted JDBC connectionschema - the database schema. Note that the schema name is case sensitive. This
is necessary because schemas with the same name but different case can coexist on one
database.
create user dbunittest identified by dbunittest;
create user "dbunittest" identified by "dbunittest";
The first one creates the "default" user where everything is interpreted by oracle in uppercase.
The second one is completely lowercase because of the quotes.DatabaseUnitExceptionpublic DatabaseConnection(Connection connection, String schema, boolean validate) throws DatabaseUnitException
DatabaseConnection using a specific schema.connection - the adapted JDBC connectionschema - the database schema. Note that the schema name is case sensitive. This
is necessary because schemas with the same name but different case can coexist on one
database.
create user dbunittest identified by dbunittest;
create user "dbunittest" identified by "dbunittest";
The first one creates the "default" user where everything is interpreted by oracle in uppercase.
The second one is completely lowercase because of the quotes.validate - If true an exception is thrown when the given schema
does not exist according to the DatabaseMetaData. If false the validation
will only print a warning if the schema was not found.DatabaseUnitException - If the validate parameter is true and the
validation of the given connection/schema was not successful (added with 2.3.0). This can happen if the given
schema does not exist or if the jdbc driver does not implement the metaData.getSchemas() method properly.public Connection getConnection() throws SQLException
IDatabaseConnectiongetConnection in interface IDatabaseConnectionSQLExceptionpublic String getSchema()
IDatabaseConnectiongetSchema in interface IDatabaseConnectionpublic void close()
throws SQLException
IDatabaseConnectionclose in interface IDatabaseConnectionSQLExceptionpublic String toString()
toString in class AbstractDatabaseConnectionCopyright © 2002-2017. All Rights Reserved.