Interface IDBConnectionPool
public interface IDBConnectionPool
Interface used to retrieve a connection from a connection pool.
- Author:
- Christopher Mindus
Nested Class Summary
Nested ClassesField Summary
FieldsModifier and TypeFieldDescriptionstatic final StringProperty name: class path, comma separated.static final StringProperty name: default auto-commit flag.static final StringProperty name: description.static final StringProperty name: driver class name.static final StringProperty name: password.static final StringProperty name: JDBC URL.static final StringProperty name: user name.Method Summary
Field Details
PN_DESCRIPTION
PN_CLASS_PATH
Property name: class path, comma separated. Specify comma twice for a single comma.- See Also:
PN_DRIVER_CLASS_NAME
PN_URL
PN_USER_NAME
PN_PASSWORD
PN_DEFAULT_AUTO_COMMIT
Method Details
getConnection
Gets a connection from the pool.- Throws:
SQLException- For SQL errors.
getFlavor
IDBConnectionPool.Flavor getFlavor()Gets the JDBC Driver flavor.- Returns:
- one of the flavors:
IDBConnectionPool.Flavor.FLAVOR_DERBY,IDBConnectionPool.Flavor.FLAVOR_MYSQL,IDBConnectionPool.Flavor.FLAVOR_POSTGRE[not yet supported],IDBConnectionPool.Flavor.FLAVOR_SQLSERVER[not yet supported],IDBConnectionPool.Flavor.FLAVOR_DB2[not yet supported], orIDBConnectionPool.Flavor.FLAVOR_UNKNOWN.
getName
dispose
Disposes of the pool.Closes and releases all idle connections that are currently stored in the connection pool associated with this data source.
Connections that are checked out to clients when this method is invoked are not affected. When client applications subsequently invoke
Connection.close()to return these connections to the pool, the underlying JDBC connections are closed.Attempts to acquire connections using
getConnection()after this method has been invoked result in SQLExceptions.This method is idempotent - i.e., closing an already closed BasicDataSource has no effect and does not generate exceptions.
- Throws:
SQLException- If an error occurs closing idle connections
isDisposed
boolean isDisposed()Checks if the connection pool is disposed of.- Returns:
- true for disposed of, false if not disposed of and ready.