public class JDBCResourceFactory extends ResourceFactory
Constructor and Description |
---|
JDBCResourceFactory(String databaseName,
String userName,
String password)
Create the factory.
|
JDBCResourceFactory(String databaseName,
String userName,
String password,
boolean verifyThatConnectionCanBeOpened)
Create the factory.
|
Modifier and Type | Method and Description |
---|---|
protected Connection |
allocateRealConnection(String databaseName,
String userName,
String password)
Allocate a real database connection from the DriverManager
|
protected void |
freeRealConnection(Connection connection)
Free a real database connection
|
protected ManagedResource |
getResourceImpl(ResourceManager resourceManager)
Allocate a resource for the specified store
|
boolean |
reinitializeResourceIfPossible(ManagedResource resource)
Reinitialize the resource to a known state.
|
protected void |
releaseResourceImpl(ResourceManager resourceManager,
ManagedResource resource)
Release the specified resource.
|
getResource, releaseAllResources, releaseResource
public JDBCResourceFactory(String databaseName, String userName, String password) throws SQLException
databaseName
- The name of the databaseuserName
- The user id that we will use to connect to the databasepassword
- The password for the specified userSQLException
- If an error occurspublic JDBCResourceFactory(String databaseName, String userName, String password, boolean verifyThatConnectionCanBeOpened) throws SQLException
databaseName
- The name of the databaseuserName
- The user id that we will use to connect to the databasepassword
- The password for the specified userverifyThatConnectionCanBeOpened
- If true than one connection will
be immediately allocated and then freed from the specified databaseSQLException
- If an error occurspublic boolean reinitializeResourceIfPossible(ManagedResource resource)
reinitializeResourceIfPossible
in class ResourceFactory
resource
- the resource to reinitializeprotected ManagedResource getResourceImpl(ResourceManager resourceManager) throws Exception
getResourceImpl
in class ResourceFactory
resourceManager
- The resource manager that owns this factoryException
- If an error occursprotected void releaseResourceImpl(ResourceManager resourceManager, ManagedResource resource) throws Exception
releaseResourceImpl
in class ResourceFactory
resource
- The resource that we are releasingresourceManager
- The manager that is controlling this factoryException
- If an error occursprotected final Connection allocateRealConnection(String databaseName, String userName, String password) throws SQLException
databaseName
- The name of the databaseuserName
- The user id that we will use to connect to the databasepassword
- The password for the specified userSQLException
- If an error occursprotected final void freeRealConnection(Connection connection) throws SQLException
connection
- The connection to releaseSQLException
- If an error occursCopyright © 1998–2014 Gargoyle Software Inc.. All rights reserved.