|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.java.ao.DatabaseProvider
net.java.ao.PoolProvider
net.java.ao.db.ProxoolPoolProvider
public class ProxoolPoolProvider
Constructor Summary | |
---|---|
ProxoolPoolProvider(DatabaseProvider delegate)
|
|
ProxoolPoolProvider(DatabaseProvider delegate,
String alias)
|
Method Summary | |
---|---|
void |
dispose()
Should release all resources held by the pool. |
protected Connection |
getConnectionImpl()
Creates a new connection to the database prepresented by the provider instance. |
Class<? extends Driver> |
getDriverClass()
Returns the JDBC Driver class which corresponds to the database being abstracted. |
static boolean |
isAvailable()
|
Methods inherited from class net.java.ao.PoolProvider |
---|
getDelegate, getTables, insertReturningKey, parseValue, putNull, renderAction, renderAutoIncrement, renderQuery, setPostConnectionProperties, setQueryResultSetProperties, setQueryStatementProperties |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ProxoolPoolProvider(DatabaseProvider delegate) throws org.logicalcobwebs.proxool.ProxoolException
org.logicalcobwebs.proxool.ProxoolException
public ProxoolPoolProvider(DatabaseProvider delegate, String alias) throws org.logicalcobwebs.proxool.ProxoolException
org.logicalcobwebs.proxool.ProxoolException
Method Detail |
---|
public Class<? extends Driver> getDriverClass() throws ClassNotFoundException
DatabaseProvider
Returns the JDBC Driver class which corresponds to the database being abstracted. This should be implemented in such a way as to initialize and register the driver with JDBC. For most drivers, this requires code in the following form:
public Class<? extends Driver> getDriverClass() { return (Class<? extends Driver>) Class.forName("com.mysql.jdbc.Driver"); }
The following does not fire the driver's static initializer and thus will (usually) not work:
public Class<? extends Driver> getDriverClass() { return com.mysql.jdbc.Driver.class; }
If the driver is not on the classpath, a ClassNotFoundException
can and should be thrown (certain auto-magic configuration sections of
ActiveObjects depend upon this under certain circumstances).
getDriverClass
in class PoolProvider
null
ClassNotFoundException
protected Connection getConnectionImpl() throws SQLException
DatabaseProvider
Creates a new connection to the database prepresented by the
provider instance. This method should not attempt to do any
caching of any kind (unless implemented by a connection pool
library). Prior to creating the database connection, this
method makes a call to DatabaseProvider.getDriverClass()
to ensure that
the JDBC driver has been loaded. The return value is not
checked for validity.
This method is never called directly. Instead, the
DatabaseProvider.getConnection()
method should be used.
getConnectionImpl
in class DatabaseProvider
null
if the driver could not be loaded.
SQLException
public void dispose()
PoolProvider
Should release all resources held by the pool. This is especially important to implement for pool providers, as conection pools may have connections which are being held (potentially) indefinitely. It is important for developers to call this method to free resources, as well as it is important for custom implementation authors to implement the method to perform such a function.
Implementations should take the following form:
public void dispose() { connectionPool.freeAllConnections(); super.dispose(); }
This method additionally delegates its call to the delegate provider instance, ensuring that (for databases which require it) database resources are appropriately freed.
dispose
in class PoolProvider
DatabaseProvider.dispose()
public static boolean isAvailable()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |