Package com.iizix.jdbc
Interface IDBConnectionPool
public interface IDBConnectionPoolInterface used to retrieve a connection from a connection pool.- Author:
- Christopher Mindus
Field Summary
Fields Modifier and Type Field Description static intFLAVOR_DB2Flavor for JDBC: DB2.static intFLAVOR_DERBYFlavor for JDBC: Derby.static intFLAVOR_MYSQLFlavor for JDBC: MySQL.static intFLAVOR_POSTGREFlavor for JDBC: PostgreSQL.static intFLAVOR_SQLSERVERFlavor for JDBC: SQL Server.static intFLAVOR_UNKNOWNUnknown flavor for JDBC Driver.static java.lang.StringPN_CLASS_PATHProperty name: class path, comma separated.static java.lang.StringPN_DEFAULT_AUTO_COMMITProperty name: default auto-commit flag.static java.lang.StringPN_DESCRIPTIONProperty name: description.static java.lang.StringPN_DRIVER_CLASS_NAMEProperty name: driver class name.static java.lang.StringPN_PASSWORDProperty name: password.static java.lang.StringPN_URLProperty name: JDBC URL.static java.lang.StringPN_USER_NAMEProperty name: user name.
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voiddispose()Disposes of the pool.java.sql.ConnectiongetConnection()Gets a connection from the pool.intgetFlavor()Gets the JDBC Driver flavor.java.lang.StringgetName()Gets the name of the connection pool.booleanisDisposed()Checks if the connection pool is disposed of.
Field Detail
FLAVOR_UNKNOWN
static final int FLAVOR_UNKNOWN
Unknown flavor for JDBC Driver.- See Also:
- Constant Field Values
FLAVOR_DERBY
static final int FLAVOR_DERBY
Flavor for JDBC: Derby.- See Also:
- Constant Field Values
FLAVOR_MYSQL
static final int FLAVOR_MYSQL
Flavor for JDBC: MySQL.- See Also:
- Constant Field Values
FLAVOR_POSTGRE
static final int FLAVOR_POSTGRE
Flavor for JDBC: PostgreSQL.- See Also:
- Constant Field Values
FLAVOR_SQLSERVER
static final int FLAVOR_SQLSERVER
Flavor for JDBC: SQL Server.- See Also:
- Constant Field Values
FLAVOR_DB2
static final int FLAVOR_DB2
Flavor for JDBC: DB2.- See Also:
- Constant Field Values
PN_DESCRIPTION
static final java.lang.String PN_DESCRIPTION
Property name: description.- See Also:
- Constant Field Values
PN_CLASS_PATH
static final java.lang.String PN_CLASS_PATH
Property name: class path, comma separated. Specify comma twice for a single comma.- See Also:
- Constant Field Values
PN_DRIVER_CLASS_NAME
static final java.lang.String PN_DRIVER_CLASS_NAME
Property name: driver class name.- See Also:
- Constant Field Values
PN_URL
static final java.lang.String PN_URL
Property name: JDBC URL.- See Also:
- Constant Field Values
PN_USER_NAME
static final java.lang.String PN_USER_NAME
Property name: user name.- See Also:
- Constant Field Values
PN_PASSWORD
static final java.lang.String PN_PASSWORD
Property name: password.- See Also:
- Constant Field Values
PN_DEFAULT_AUTO_COMMIT
static final java.lang.String PN_DEFAULT_AUTO_COMMIT
Property name: default auto-commit flag.- See Also:
- Constant Field Values
Method Detail
getConnection
java.sql.Connection getConnection() throws java.sql.SQLExceptionGets a connection from the pool.- Throws:
java.sql.SQLException- For SQL errors.
getFlavor
int getFlavor()
Gets the JDBC Driver flavor.- Returns:
- one of the flavors:
FLAVOR_DERBY,FLAVOR_MYSQL,FLAVOR_POSTGRE[not yet supported],FLAVOR_SQLSERVER[not yet supported],FLAVOR_DB2[not yet supported].
getName
java.lang.String getName()
Gets the name of the connection pool.- Returns:
- The name of the connection pool.
dispose
void dispose() throws java.sql.SQLExceptionDisposes 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:
java.sql.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.