|
|||||||||
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.DBPoolProvider
public class DBPoolProvider
Constructor Summary | |
---|---|
DBPoolProvider(DatabaseProvider delegate)
|
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. |
static boolean |
isAvailable()
|
Methods inherited from class net.java.ao.PoolProvider |
---|
getDelegate, getDriverClass, 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 DBPoolProvider(DatabaseProvider delegate)
Method Detail |
---|
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 |