Modifier and Type | Field and Description |
---|---|
private TestConfiguration |
config |
Constructor and Description |
---|
DriverManagerConnector() |
Modifier and Type | Method and Description |
---|---|
private java.sql.Connection |
getConnectionByAttributes(java.lang.String url,
java.util.Properties p)
Open a connection using JDBC attributes with a JDBC URL.
|
java.lang.String |
getDatabaseName()
get the physical databasename in use at this time
|
int |
getLoginTimeout()
Get the login timeout in seconds.
|
private void |
loadJDBCDriver()
Load the JDBC driver defined by the JDBCClient for
the 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 using the DriverManager.
|
java.sql.Connection |
openConnection(java.lang.String databaseName,
java.lang.String user,
java.lang.String password,
java.util.Properties connectionProperties)
Open a connection using the DriverManager.
|
private static void |
printFullException(java.lang.Throwable t,
int indentLevel) |
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 database using the attributes shutdown=true
with the user and password defined by the configuration.
|
void |
shutEngine(boolean deregisterDriver)
Shutdown the engine using the attributes shutdown=true
and no database name with the user and password defined
by the configuration.
|
private TestConfiguration config
public void setConfiguration(TestConfiguration config)
Connector
setConfiguration
in interface Connector
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
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
openConnection
in interface Connector
java.sql.SQLException
private static void printFullException(java.lang.Throwable t, int indentLevel)
public void shutDatabase() throws java.sql.SQLException
shutDatabase
in interface Connector
java.sql.SQLException
public void shutEngine(boolean deregisterDriver) throws java.sql.SQLException
shutEngine
in interface Connector
deregisterDriver
- java.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
private java.sql.Connection getConnectionByAttributes(java.lang.String url, java.util.Properties p) throws java.sql.SQLException
java.sql.SQLException
public java.lang.String getDatabaseName()
Connector
getDatabaseName
in interface Connector
private void loadJDBCDriver() throws java.sql.SQLException
java.sql.SQLException
- if loading the driver fails.Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.