interface Connector
Tests that need finer control over the connection handling should use the JDBC classes directly, such as DriverManager or DataSource.
This is split out into an interface and sub-classes to ensure that no ClassNotFoundExceptions are thrown when running in an JSR 169 environment and DriverManager is not available.
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getDatabaseName()
get the physical databasename in use at this time
|
int |
getLoginTimeout()
Get the login timeout in seconds.
|
java.sql.Connection |
openConnection()
Open a connection with the database, user and password
defined by the configuration passed to setConfiguration.
|
java.sql.Connection |
openConnection(java.lang.String databaseName)
Open a connection with the database, user and password
defined by the configuration passed to setConfiguration.
|
java.sql.Connection |
openConnection(java.lang.String user,
java.lang.String password)
Open a connection to the database
defined by the configuration passed to setConfiguration.
|
java.sql.Connection |
openConnection(java.lang.String databaseName,
java.lang.String user,
java.lang.String password)
Open a connection to the database
defined by the configuration passed to setConfiguration.
|
java.sql.Connection |
openConnection(java.lang.String databaseName,
java.lang.String user,
java.lang.String password,
java.util.Properties connectionProperties)
Open a connection to the database
defined by the configuration passed to setConfiguration.
|
void |
setConfiguration(TestConfiguration config)
Link this connector to the given configuration.
|
void |
setLoginTimeout(int seconds)
Set the login timeout for getting connections.
|
void |
shutDatabase()
Shutdown the running default database using user and password
defined by the configuration passed to setConfiguration.
|
void |
shutEngine(boolean deregisterDriver)
Shutdown the running derby engine (not the network server).
|
void setConfiguration(TestConfiguration config)
java.sql.Connection openConnection() throws java.sql.SQLException
java.sql.SQLException
java.sql.Connection openConnection(java.lang.String databaseName) throws java.sql.SQLException
java.sql.SQLException
java.sql.Connection openConnection(java.lang.String user, java.lang.String password) throws java.sql.SQLException
java.sql.SQLException
java.sql.Connection openConnection(java.lang.String databaseName, java.lang.String user, java.lang.String password) throws java.sql.SQLException
java.sql.SQLException
java.sql.Connection openConnection(java.lang.String databaseName, java.lang.String user, java.lang.String password, java.util.Properties connectionProperties) throws java.sql.SQLException
java.sql.SQLException
java.lang.String getDatabaseName()
void shutDatabase() throws java.sql.SQLException
java.sql.SQLException
void shutEngine(boolean deregisterDriver) throws java.sql.SQLException
deregisterDriver
- if true, deregister driverjava.sql.SQLException
void setLoginTimeout(int seconds) throws java.sql.SQLException
java.sql.SQLException
int getLoginTimeout() throws java.sql.SQLException
java.sql.SQLException
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.