|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opensubsystems.core.persist.db.DatabaseConnectionFactoryImpl
org.opensubsystems.core.persist.db.connectionpool.PooledDatabaseConnectionFactoryImpl
org.opensubsystems.core.persist.db.connectionpool.C3P0DatabaseConnectionFactoryImpl
public class C3P0DatabaseConnectionFactoryImpl
Implementation of connection pool using C3P0 connection pool. (http://sourceforge.net/projects/c3p0/)
| Field Summary |
|---|
| Fields inherited from class org.opensubsystems.core.persist.db.connectionpool.PooledDatabaseConnectionFactoryImpl |
|---|
DEFAULT_DATASOURCE_NAME, m_defaultConnectionPool, m_mpConnectionPoolCrossRef, m_mpConnectionPools, m_mpNotPooledConnections |
| Constructor Summary | |
|---|---|
C3P0DatabaseConnectionFactoryImpl()
Constructor for new instance using default database properties. |
|
C3P0DatabaseConnectionFactoryImpl(DatabaseTransactionFactoryImpl transactionFactory)
Constructor for new instance using default database properties. |
|
C3P0DatabaseConnectionFactoryImpl(java.lang.String strDriver,
java.lang.String strURL,
java.lang.String strUser,
java.lang.String strPassword,
DatabaseTransactionFactoryImpl transactionFactory)
Constructor for new instance using explicitely specified properties. |
|
| Method Summary | |
|---|---|
protected void |
closeConnectionPool(org.opensubsystems.core.persist.db.connectionpool.PooledDatabaseConnectionFactoryImpl.ConnectionPoolDefinition connectionpool)
Close the specified connection pool and all connections maintained to database by this connection pool. |
protected java.lang.Object |
createConnectionPool(java.lang.String strConnectionPoolName,
java.lang.String strDriverName,
java.lang.String strUrl,
java.lang.String strUser,
java.lang.String strPassword)
Create new connection pool with specified parameters. |
protected java.sql.Connection |
getPooledConnection(org.opensubsystems.core.persist.db.connectionpool.PooledDatabaseConnectionFactoryImpl.ConnectionPoolDefinition connectionpool)
Get connection for given connection pool. |
protected java.sql.Connection |
getPooledConnection(org.opensubsystems.core.persist.db.connectionpool.PooledDatabaseConnectionFactoryImpl.ConnectionPoolDefinition connectionpool,
java.lang.String strUser,
java.lang.String strPassword)
Get connection using the same settings as given connection pool but get the connection under different name and password. |
| Methods inherited from class org.opensubsystems.core.persist.db.connectionpool.PooledDatabaseConnectionFactoryImpl |
|---|
addDataSource, debug, getDefaultDataSourceName, getRequestedConnectionCount, getRequestedConnectionCount, isDataSourceDefined, requestNonTransactionalConnection, requestNonTransactionalConnection, requestNonTransactionalConnection, requestNonTransactionalConnection, returnNonTransactionalConnection, returnPooledConnection, setDefaultDataSourceName, start, stop |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public C3P0DatabaseConnectionFactoryImpl()
throws OSSConfigException,
OSSDatabaseAccessException
OSSConfigException - - if there was an error accessing default database
properties
OSSDatabaseAccessException - - problem accessing the database
public C3P0DatabaseConnectionFactoryImpl(DatabaseTransactionFactoryImpl transactionFactory)
throws OSSConfigException,
OSSDatabaseAccessException
transactionFactory - - transaction factory to use for this
connection factory, can be null
OSSConfigException - - if there was an error accessing default database
properties
OSSDatabaseAccessException - - problem accessing the database
public C3P0DatabaseConnectionFactoryImpl(java.lang.String strDriver,
java.lang.String strURL,
java.lang.String strUser,
java.lang.String strPassword,
DatabaseTransactionFactoryImpl transactionFactory)
throws OSSConfigException,
OSSDatabaseAccessException
strDriver - - JDBC driver to connect to the databasestrURL - - URL of database to connect tostrUser - - user name to connect to the databasestrPassword - - password to the databasetransactionFactory - - transaction factory to use for this
connection factory, can be null
OSSConfigException - - problem accessing or locating the config file.
OSSDatabaseAccessException - - problem accessing the database| Method Detail |
|---|
protected java.sql.Connection getPooledConnection(org.opensubsystems.core.persist.db.connectionpool.PooledDatabaseConnectionFactoryImpl.ConnectionPoolDefinition connectionpool)
throws OSSDatabaseAccessException
getPooledConnection in class PooledDatabaseConnectionFactoryImplconnectionpool - - connection pool to get connection for
OSSDatabaseAccessException - - an error getting connection
protected java.sql.Connection getPooledConnection(org.opensubsystems.core.persist.db.connectionpool.PooledDatabaseConnectionFactoryImpl.ConnectionPoolDefinition connectionpool,
java.lang.String strUser,
java.lang.String strPassword)
throws OSSDatabaseAccessException
getPooledConnection in class PooledDatabaseConnectionFactoryImplconnectionpool - - connection pool defining settings to get connection forstrUser - - user name to get the connection forstrPassword - - password to get the connection for
OSSDatabaseAccessException - - an error getting connection
protected java.lang.Object createConnectionPool(java.lang.String strConnectionPoolName,
java.lang.String strDriverName,
java.lang.String strUrl,
java.lang.String strUser,
java.lang.String strPassword)
throws OSSException
createConnectionPool in class PooledDatabaseConnectionFactoryImplstrConnectionPoolName - - connection pool namestrDriverName - - name of the JDBC driverstrUrl - - url by which data source connects to the databasestrUser - - user name to connects to the databasestrPassword - - password to connects to the database
OSSException - - an error has occured during creation of connection pool
protected void closeConnectionPool(org.opensubsystems.core.persist.db.connectionpool.PooledDatabaseConnectionFactoryImpl.ConnectionPoolDefinition connectionpool)
throws OSSException
closeConnectionPool in class PooledDatabaseConnectionFactoryImplconnectionpool - - connection pool to close.
OSSException - - an error has occured during closing of the connection pool
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||