|
|||||||||
| 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.J2EEDatabaseConnectionFactoryImpl
public class J2EEDatabaseConnectionFactoryImpl
Base class for implementation of j2ee factories for retrieving and returning of database connections, which are maintained in a pool of always ready connections.
| Field Summary | |
|---|---|
static java.lang.String |
DATASOURCE_NAME_PREFIX_JBOSS
Prefix of the data source that will be used for all data sources specified in JBoss server. |
static java.lang.String |
DATASOURCE_NAME_PREFIX_WEBSPHERE
Prefix of the data source that will be used for all data sources specified in IBM WebSphere server. |
| Fields inherited from class org.opensubsystems.core.persist.db.connectionpool.PooledDatabaseConnectionFactoryImpl |
|---|
DEFAULT_DATASOURCE_NAME, m_defaultConnectionPool, m_mpConnectionPoolCrossRef, m_mpConnectionPools, m_mpNotPooledConnections |
| Constructor Summary | |
|---|---|
J2EEDatabaseConnectionFactoryImpl()
|
|
| 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. |
java.lang.String |
getDatabaseAdminPassword()
Returns the database administration password. |
java.lang.String |
getDatabaseAdminUser()
Returns the database administration user. |
java.lang.String |
getDatabaseDriver()
Returns the database driver identification. |
java.lang.String |
getDatabasePassword()
Returns the database password. |
java.lang.String |
getDatabaseURL()
Returns the database URL. |
java.lang.String |
getDatabaseUser()
Returns the database user. |
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. |
java.lang.String |
getRealDatabaseDriver()
Get real driver name which is used to connect to database. |
protected void |
initializeConnection(java.sql.Connection cntDBConnection,
boolean bAutoCommit)
Initialize connection to the default state so it can be used to work with the database. |
| 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 org.opensubsystems.core.persist.db.DatabaseConnectionFactoryImpl |
|---|
getInstance, getTotalRequestedConnectionCount, getUseAdminDataSource, initializeDriver, loadDefaultDatabaseProperties, requestConnection, requestConnection, requestConnection, requestConnection, returnConnection, setDatabaseAdminPassword, setDatabaseAdminUser, setDatabaseDriver, setDatabasePassword, setDatabaseURL, setDatabaseUser, setInstance, setTransactionFactory, setUseAdminDataSource |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String DATASOURCE_NAME_PREFIX_JBOSS
public static final java.lang.String DATASOURCE_NAME_PREFIX_WEBSPHERE
| Constructor Detail |
|---|
public J2EEDatabaseConnectionFactoryImpl()
| Method Detail |
|---|
public java.lang.String getRealDatabaseDriver()
getRealDatabaseDriver in interface DatabaseConnectionFactorygetRealDatabaseDriver in class DatabaseConnectionFactoryImplpublic java.lang.String getDatabaseDriver()
getDatabaseDriver in interface DatabaseConnectionFactorygetDatabaseDriver in class DatabaseConnectionFactoryImplpublic java.lang.String getDatabaseURL()
getDatabaseURL in interface DatabaseConnectionFactorygetDatabaseURL in class DatabaseConnectionFactoryImplpublic java.lang.String getDatabaseAdminUser()
getDatabaseAdminUser in interface DatabaseConnectionFactorygetDatabaseAdminUser in class DatabaseConnectionFactoryImplpublic java.lang.String getDatabaseAdminPassword()
getDatabaseAdminPassword in interface DatabaseConnectionFactorygetDatabaseAdminPassword in class DatabaseConnectionFactoryImplpublic java.lang.String getDatabaseUser()
getDatabaseUser in interface DatabaseConnectionFactorygetDatabaseUser in class DatabaseConnectionFactoryImplpublic java.lang.String getDatabasePassword()
getDatabasePassword in interface DatabaseConnectionFactorygetDatabasePassword in class DatabaseConnectionFactoryImpl
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
protected void initializeConnection(java.sql.Connection cntDBConnection,
boolean bAutoCommit)
throws java.sql.SQLException
initializeConnection in class DatabaseConnectionFactoryImplcntDBConnection - - valid connection to the databasebAutoCommit - - The desired autocommit state of the connection. If
this connection is invoked in global (JTA) transaction
then the autocommit is false regardless of what
value is specified here. Use true here if the client
only reads the data and false if the client also
modifies the data.
Use DatabaseTransactionFactory.commitTransaction
to commit the transaction.
java.sql.SQLException - - problem initializing the connection
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||