|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.gargoylesoftware.base.resource.ResourceFactory com.gargoylesoftware.base.resource.jdbc.JDBCResourceFactory
A ResourceFactory for JDBC connections
Constructor Summary | |
JDBCResourceFactory(String databaseName,
String userName,
String password)
Create the factory. |
|
JDBCResourceFactory(String databaseName,
String userName,
String password,
boolean verifyThatConnectionCanBeOpened)
Create the factory. |
Method Summary | |
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. |
Methods inherited from class com.gargoylesoftware.base.resource.ResourceFactory |
getResource, releaseAllResources, releaseResource |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
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 user
SQLException
- 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 database
SQLException
- If an error occursMethod Detail |
public boolean reinitializeResourceIfPossible(ManagedResource resource)
reinitializeResourceIfPossible
in class ResourceFactory
resource
- the resource to reinitialize
protected ManagedResource getResourceImpl(ResourceManager resourceManager) throws Exception
getResourceImpl
in class ResourceFactory
resourceManager
- The resource manager that owns this factory
Exception
- 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 factory
Exception
- 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 user
SQLException
- If an error occursprotected final void freeRealConnection(Connection connection) throws SQLException
connection
- The connection to release
SQLException
- If an error occurs
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |