IBM Branch Transformation Toolkit Javadoc

com.ibm.btt.services.jdbcservicesinfra
Class JDBCServicesConnMgrWS40z

java.lang.Object
  extended bycom.ibm.btt.services.jdbcservicesinfra.JDBCServicesConnMgrWS40z
All Implemented Interfaces:
JDBCServicesConnectionManagementInterface

public class JDBCServicesConnMgrWS40z
extends java.lang.Object
implements JDBCServicesConnectionManagementInterface

Implementation of the JDBCServicesConnectionManagementInterface interface to use the pool of connections provided by WebSphere 4.0 in an OS/390 environment.


Field Summary
protected  Hashtable dataSourcesHashtable
          Keeps a hashtable containing the different data sources that have been obtained from the naming service.
protected  javax.naming.Context nsInitialContext
          Keeps the naming service initial context where the connection pooling data source is defined.
 
Constructor Summary
JDBCServicesConnMgrWS40z()
          This constructor creates a JDBCServicesConnMgrWS40 instance.
 
Method Summary
 void disconnect(Hashtable connProperties, java.sql.Connection connection)
          Releases the database connection to the pool of connections managed by WebSphere 4.0.
protected  Hashtable getDataSourcesHashtable()
          Returns the hashtable containg the different connection pooling data sources.
protected  javax.naming.Context getNsInitialContext()
          Returns the naming service initial context.
 java.sql.Connection requestConnection(Hashtable connProperties)
          Requests the database connection to the WebSphere 4.0 pool of connections with the connection properties set in the connProperties hashtable.
protected  void setDataSourcesHashtable(Hashtable newDataSourcesHashtable)
          Sets the data source hashtable to a new value.
protected  void setNsInitialContext(javax.naming.Context newNsInitialContext)
          Sets the nsInitialContext attribute to the naming service context newNsInitialContext.
 boolean verifyConnection(java.sql.Connection aConnection)
          Checks for the availability of the database connection by catching the exception that will be thrown if the connection pooling has considered it as an orphan connection (ConnectionPreemptedException exception).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nsInitialContext

protected javax.naming.Context nsInitialContext
Keeps the naming service initial context where the connection pooling data source is defined.


dataSourcesHashtable

protected Hashtable dataSourcesHashtable
Keeps a hashtable containing the different data sources that have been obtained from the naming service.

Constructor Detail

JDBCServicesConnMgrWS40z

public JDBCServicesConnMgrWS40z()
This constructor creates a JDBCServicesConnMgrWS40 instance.

Method Detail

disconnect

public void disconnect(Hashtable connProperties,
                       java.sql.Connection connection)
                throws DSESQLException
Releases the database connection to the pool of connections managed by WebSphere 4.0.

Specified by:
disconnect in interface JDBCServicesConnectionManagementInterface
Parameters:
connProperties - com.ibm.dse.base.Hashtable
connection - java.sql.Connection
Throws:
DSESQLException - if an SQLException is caught

getDataSourcesHashtable

protected Hashtable getDataSourcesHashtable()
Returns the hashtable containg the different connection pooling data sources.

Returns:
com.ibm.dse.base.Hashtable

getNsInitialContext

protected javax.naming.Context getNsInitialContext()
Returns the naming service initial context.

Returns:
javax.naming.Context

requestConnection

public java.sql.Connection requestConnection(Hashtable connProperties)
                                      throws DSESQLException,
                                             DSEException
Requests the database connection to the WebSphere 4.0 pool of connections with the connection properties set in the connProperties hashtable.

Specified by:
requestConnection in interface JDBCServicesConnectionManagementInterface
Parameters:
connProperties - com.ibm.dse.base.Hashtable
Returns:
java.sql.Connection
Throws:
DSESQLException - if an SQLException is caught
DSEException - if an exception is thrown when calling the pool of connections manager

setDataSourcesHashtable

protected void setDataSourcesHashtable(Hashtable newDataSourcesHashtable)
Sets the data source hashtable to a new value.

Parameters:
newDataSourcesHashtable - com.ibm.dse.base.Hashtable

setNsInitialContext

protected void setNsInitialContext(javax.naming.Context newNsInitialContext)
Sets the nsInitialContext attribute to the naming service context newNsInitialContext.

Parameters:
newNsInitialContext - javax.naming.Context

verifyConnection

public boolean verifyConnection(java.sql.Connection aConnection)
                         throws DSESQLException
Checks for the availability of the database connection by catching the exception that will be thrown if the connection pooling has considered it as an orphan connection (ConnectionPreemptedException exception).

Specified by:
verifyConnection in interface JDBCServicesConnectionManagementInterface
Parameters:
aConnection - java.sql.Connection
Throws:
DSESQLException - if an SQLException is caught

IBM Branch Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2005