| Modifier and Type | Field and Description |
|---|---|
private TestConfiguration |
config |
private javax.sql.DataSource |
ds
DataSource that maps to the database for the
configuration.
|
| Constructor and Description |
|---|
DataSourceConnector() |
| 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.
|
(package private) static java.util.HashMap |
makeCreateDBAttributes(TestConfiguration configuration) |
(package private) static java.util.HashMap |
makeShutdownDBAttributes(TestConfiguration configuration) |
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()
Shutdown the running derby engine (not the network server).
|
private javax.sql.DataSource |
singleUseDS(java.util.HashMap hm)
Get a connection from a single use DataSource configured
from the configuration but with the passed in property set.
|
private TestConfiguration config
private javax.sql.DataSource ds
public void setConfiguration(TestConfiguration config)
ConnectorsetConfiguration in interface Connectorpublic java.sql.Connection openConnection()
throws java.sql.SQLException
ConnectoropenConnection in interface Connectorjava.sql.SQLExceptionpublic java.sql.Connection openConnection(java.lang.String databaseName)
throws java.sql.SQLException
ConnectoropenConnection in interface Connectorjava.sql.SQLExceptionpublic java.sql.Connection openConnection(java.lang.String user,
java.lang.String password)
throws java.sql.SQLException
ConnectoropenConnection in interface Connectorjava.sql.SQLExceptionpublic java.sql.Connection openConnection(java.lang.String databaseName,
java.lang.String user,
java.lang.String password)
throws java.sql.SQLException
ConnectoropenConnection in interface Connectorjava.sql.SQLExceptionpublic java.sql.Connection openConnection(java.lang.String databaseName,
java.lang.String user,
java.lang.String password,
java.util.Properties connectionProperties)
throws java.sql.SQLException
ConnectoropenConnection in interface Connectorjava.sql.SQLExceptionpublic void shutDatabase()
throws java.sql.SQLException
ConnectorshutDatabase in interface Connectorjava.sql.SQLExceptionpublic void shutEngine()
throws java.sql.SQLException
ConnectorshutEngine in interface Connectorjava.sql.SQLExceptionpublic void setLoginTimeout(int seconds)
throws java.sql.SQLException
ConnectorsetLoginTimeout in interface Connectorjava.sql.SQLExceptionpublic int getLoginTimeout()
throws java.sql.SQLException
ConnectorgetLoginTimeout in interface Connectorjava.sql.SQLExceptionprivate javax.sql.DataSource singleUseDS(java.util.HashMap hm)
throws java.sql.SQLException
java.sql.SQLExceptionstatic java.util.HashMap makeCreateDBAttributes(TestConfiguration configuration)
static java.util.HashMap makeShutdownDBAttributes(TestConfiguration configuration)
public java.lang.String getDatabaseName()
ConnectorgetDatabaseName in interface ConnectorApache Derby V10.10 Internals - Copyright © 2004,2014 The Apache Software Foundation. All Rights Reserved.