Modifier and Type | Field and Description |
---|---|
private TestConfiguration |
config |
private javax.sql.ConnectionPoolDataSource |
ds
DataSource that maps to the database for the
configuration.
|
Constructor and Description |
---|
ConnectionPoolDataSourceConnector() |
Modifier and Type | Method and Description |
---|---|
private static void |
enableStatementPooling(javax.sql.ConnectionPoolDataSource ds)
Enable statement pooling on the specified data source.
|
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).
|
private javax.sql.ConnectionPoolDataSource |
singleUseDS(java.util.HashMap hm)
Get a connection from a single use ConnectionPoolDataSource configured
from the configuration but with the passed in property set.
|
private TestConfiguration config
private javax.sql.ConnectionPoolDataSource ds
public void setConfiguration(TestConfiguration config)
Connector
setConfiguration
in interface Connector
private static void enableStatementPooling(javax.sql.ConnectionPoolDataSource ds)
public java.sql.Connection openConnection() throws java.sql.SQLException
Connector
openConnection
in interface Connector
java.sql.SQLException
public java.sql.Connection openConnection(java.lang.String databaseName) throws java.sql.SQLException
Connector
openConnection
in interface Connector
java.sql.SQLException
public java.sql.Connection openConnection(java.lang.String user, java.lang.String password) throws java.sql.SQLException
Connector
openConnection
in interface Connector
java.sql.SQLException
public java.sql.Connection openConnection(java.lang.String databaseName, java.lang.String user, java.lang.String password) throws java.sql.SQLException
Connector
openConnection
in interface Connector
java.sql.SQLException
public java.sql.Connection openConnection(java.lang.String databaseName, java.lang.String user, java.lang.String password, java.util.Properties connectionProperties) throws java.sql.SQLException
Connector
openConnection
in interface Connector
java.sql.SQLException
public void shutDatabase() throws java.sql.SQLException
Connector
shutDatabase
in interface Connector
java.sql.SQLException
public void shutEngine(boolean deregisterDriver) throws java.sql.SQLException
Connector
shutEngine
in interface Connector
deregisterDriver
- if true, deregister driverjava.sql.SQLException
public void setLoginTimeout(int seconds) throws java.sql.SQLException
Connector
setLoginTimeout
in interface Connector
java.sql.SQLException
public int getLoginTimeout() throws java.sql.SQLException
Connector
getLoginTimeout
in interface Connector
java.sql.SQLException
public java.lang.String getDatabaseName()
Connector
getDatabaseName
in interface Connector
private javax.sql.ConnectionPoolDataSource singleUseDS(java.util.HashMap hm) throws java.sql.SQLException
java.sql.SQLException
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.