com.gargoylesoftware.base.resource.jdbc
public class JDBCResourceFactory extends ResourceFactory
Version: $Revision: 1.4 $
Field Summary | |
---|---|
String | databaseName_ |
String | password_ |
String | userName_ |
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
|
void | ensureDatabaseCanBeOpened() |
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. |
Parameters: databaseName The name of the database userName The user id that we will use to connect to the database password The password for the specified user
Throws: SQLException If an error occurs
Parameters: databaseName The name of the database userName The user id that we will use to connect to the database password The password for the specified user verifyThatConnectionCanBeOpened If true than one connection will be immediately allocated and then freed from the specified database
Throws: SQLException If an error occurs
Parameters: databaseName The name of the database userName The user id that we will use to connect to the database password The password for the specified user
Returns: A new connection
Throws: SQLException If an error occurs
Parameters: connection The connection to release
Throws: SQLException If an error occurs
Parameters: resourceManager The resource manager that owns this factory
Returns: The new resource
Throws: Exception If an error occurs
Parameters: resource the resource to reinitialize
Returns: true if the resource was successfully reinitialized
Parameters: resource The resource that we are releasing resourceManager The manager that is controlling this factory
Throws: Exception If an error occurs