Enterprise Information Portal APIs

com.ibm.mm.sdk.server
Class DKPoolManagerJDBC

java.lang.Object
  |
  +--com.ibm.mm.sdk.server.DKPoolManagerJDBC
All Implemented Interfaces:
DKConstant, DKMessageId, java.io.Serializable

public class DKPoolManagerJDBC
extends java.lang.Object
implements DKConstant, DKMessageId, java.io.Serializable

DKPoolManagerJDBC: A DKPoolManagerJDBC object will manage multiple database(url) Connection pools.

See Also:
Serialized Form

Fields inherited from interface com.ibm.mm.sdk.common.DKConstant
    For details, see the class or interface
 
Fields inherited from interface com.ibm.mm.sdk.common.DKMessageId
    For details, see the class or interface
 
Method Summary
 void destroy()
          Destroy this pool object including all connections in both free pool and used pool
 DKHandle getConnection(java.lang.String dsName, java.lang.String userId, java.lang.String passwd)
          Gets a connection from the pool manager.
static DKPoolManagerJDBC getInstance()
          Returns the single instance
 void initConnections(java.lang.String dsName, java.lang.String userId, java.lang.String passwd, int initSize)
          Initialize number of connections and store them in the pool
 java.lang.String poolType()
          Gets the JavaPool type, this is a properties in cmbpool.ini For example: DKPoolWAS or DKPoolJDBC or ""; "" means no pool
 DKPropertyPoolJDBC propertyObject()
          Gets the property object of the pool manager.
 void returnConnection(DKHandle handle, java.lang.String dsName)
          Returns a connection to the pool
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static DKPoolManagerJDBC getInstance()
Returns the single instance
Returns:
DKPoolManagerJDBC the single instance

getConnection

public DKHandle getConnection(java.lang.String dsName,
                              java.lang.String userId,
                              java.lang.String passwd)
                       throws DKException,
                              java.lang.Exception
Gets a connection from the pool manager. For DKPoolJDBC, the pool manager contains pools of DKPoolJDBC with jdbcurl as the key. For DKPoolWAS it contains pools of DKPoolWAS with JDNI datasource name as the key. It will search for matched key, if no match found, it will create a new pool with the key.
Parameters:
dsName - the database name for connection
userId - the user name used to logon the database
passwd - the password used to logon the database
Returns:
a DKHandle that contains the Connection object (caller need to check if the DKHandle is null)

to obtain the true Connection object call like: Connection con = (Connection)aDKHandle.handle();


returnConnection

public void returnConnection(DKHandle handle,
                             java.lang.String dsName)
                      throws DKException,
                             java.lang.Exception
Returns a connection to the pool
Parameters:
dsName - the database name for connection
handle - a DKHandle that contains the Connection object

initConnections

public void initConnections(java.lang.String dsName,
                            java.lang.String userId,
                            java.lang.String passwd,
                            int initSize)
                     throws DKException,
                            java.lang.Exception
Initialize number of connections and store them in the pool
Parameters:
dsName - the database name for connection
userId - the user name used to logon the database
passwd - the password used to logon the database
initSize - the number of connection to be created

destroy

public void destroy()
             throws DKException,
                    java.lang.Exception
Destroy this pool object including all connections in both free pool and used pool

poolType

public java.lang.String poolType()
Gets the JavaPool type, this is a properties in cmbpool.ini For example: DKPoolWAS or DKPoolJDBC or ""; "" means no pool
Returns:
pool type

propertyObject

public DKPropertyPoolJDBC propertyObject()
Gets the property object of the pool manager. The property object contains the common properties for all pools managed by this pool manager.
Returns:
a DKPropertyPoolJDBC object

EIP Java APIs

(c) Copyright International Business Machines Corporation 1996, 2002. IBM Corp. All rights reserved.