Enterprise Information Portal APIs

com.ibm.mm.sdk.server
Class DKPoolWAS

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

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

DKPoolWAS: A DKPoolWAS object will use WebSphere connection pool to manage the connections for ICM connector. This require users to use the same ICM library server name as the WebSphere DataSource object name. And the DataSource object name should be already configured by the administrator in the WebSphere Administrative Console.

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
 
Constructor Summary
DKPoolWAS()
          Constructs the database connection pool
 
Method Summary
 void destroy()
          Destroy this pool object including all connections in both free pool and used pool
 java.lang.String getConfigurationString()
          (no effect now, WAS use WebSphere Administrative Console to configure) Gets the configuration string which supplies the specific initialization parameters for connection.
 DKHandle getConnection(java.lang.String userId, java.lang.String passwd)
          Gets a connection from the pool
 int getConnTimeOut()
          (no effect now, WAS use WebSphere Administrative Console to configure) Gets the number of seconds that an application waits for a connection from the pool before time out and throwing exception.
 int getIdleTimeOut()
          (no effect now, WAS use WebSphere Administrative Console to configure) Gets the number of seconds that a connection should remain unused in the pool.
 int getMaxPoolSize()
          (no effect now, WAS use WebSphere Administrative Console to configure) Gets the maximum number of connections that the pool can hold.
 int getMinPoolSize()
          (no effect now, WAS use WebSphere Administrative Console to configure) Gets the minimum number of connections that the pool might keep when all the connections are idle.
 int getOrphanTimeOut()
          (no effect now, WAS use WebSphere Administrative Console to configure) Gets the number of seconds that an application is allowed to hold an inactive connection.
 java.lang.String getServerName()
          Gets the name of the data source's name.
 void initConnections(java.lang.String userId, java.lang.String passwd, int initSize)
          (no effect now, WAS use WebSphere Administrative Console to configure) Initialize number of connections and store them in the pool
 java.lang.String poolConnectType()
          Gets the pool connect type for this connection pool For ICM in java, this will be JDBC
 void returnConnection(DKHandle handle)
          Returns a connection to the pool
 void setConfigurationString(java.lang.String configString)
          (no effect now, WAS use WebSphere Administrative Console to configure) Sets the configuration string which supplies the specific initialization parameters for connection.
 void setConnTimeOut(int connTime)
          (no effect now, WAS use WebSphere Administrative Console to configure) Sets the number of seconds that an application waits for a connection from the pool before time out and throwing exception.
 void setIdleTimeOut(int idleTime)
          (no effect now, WAS use WebSphere Administrative Console to configure) Sets the number of seconds that a connection should remain unused in the pool before the connection is disconnect & destroyed.
 void setMaxPoolSize(int poolSize)
          (no effect now, WAS use WebSphere Administrative Console to configure) Sets the maximum number of connections that the pool can hold.
 void setMinPoolSize(int poolSize)
          (no effect now, WAS use WebSphere Administrative Console to configure) Sets the minimum number of connections that the pool might keep when all connections are idle.
 void setOrphanTimeOut(int orphanTime)
          (no effect now, WAS use WebSphere Administrative Console to configure) Sets the number of seconds that an application is allowed to hold an inactive connection.
 void setServerName(java.lang.String aDSName)
          Sets the name of the data source's name.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DKPoolWAS

public DKPoolWAS()
Constructs the database connection pool
Method Detail

getServerName

public java.lang.String getServerName()
Gets the name of the data source's name. For WAS, a full path DataSource name ie."java:comp/env/jdbc/ICMNLSDB"
Specified by:
getServerName in interface dkPool
Returns:
the data source name

setServerName

public void setServerName(java.lang.String aDSName)
                   throws DKException,
                          java.lang.Exception
Sets the name of the data source's name. For WAS, a full path DataSource name ie."java:comp/env/jdbc/ICMNLSDB"
Specified by:
setServerName in interface dkPool
Parameters:
aDSName - the url name for creating connection

getConfigurationString

public java.lang.String getConfigurationString()
(no effect now, WAS use WebSphere Administrative Console to configure) Gets the configuration string which supplies the specific initialization parameters for connection. For WAS, this is the complete name of the datasource class that can be found in the JDBC resource.zip/.jar and must implementjavax.sql.ConnectionPoolDataSource or javax.sql.XADataSource Example of JDBC driver name are:

Specified by:
getConfigurationString in interface dkPool
Returns:
the configuration information

setConfigurationString

public void setConfigurationString(java.lang.String configString)
                            throws DKException,
                                   java.lang.Exception
(no effect now, WAS use WebSphere Administrative Console to configure) Sets the configuration string which supplies the specific initialization parameters for connection. For WAS, this is the complete name of the datasource class that can be found in the JDBC resource.zip/.jar and must implementjavax.sql.ConnectionPoolDataSource or javax.sql.XADataSource Example of JDBC driver name are:

Specified by:
setConfigurationString in interface dkPool
Parameters:
configString - info about connection driver

getMaxPoolSize

public int getMaxPoolSize()
(no effect now, WAS use WebSphere Administrative Console to configure) Gets the maximum number of connections that the pool can hold.
Specified by:
getMaxPoolSize in interface dkPool
Returns:
the maximum number of connection pool size

setMaxPoolSize

public void setMaxPoolSize(int poolSize)
                    throws DKException,
                           java.lang.Exception
(no effect now, WAS use WebSphere Administrative Console to configure) Sets the maximum number of connections that the pool can hold.
Specified by:
setMaxPoolSize in interface dkPool
Parameters:
poolSize - the maximum number of connection pool size

getMinPoolSize

public int getMinPoolSize()
(no effect now, WAS use WebSphere Administrative Console to configure) Gets the minimum number of connections that the pool might keep when all the connections are idle.
Specified by:
getMinPoolSize in interface dkPool
Returns:
the minimum number of connection pool size

setMinPoolSize

public void setMinPoolSize(int poolSize)
                    throws DKException,
                           java.lang.Exception
(no effect now, WAS use WebSphere Administrative Console to configure) Sets the minimum number of connections that the pool might keep when all connections are idle.
Specified by:
setMinPoolSize in interface dkPool
Parameters:
poolSize - the minimum number of connection pool size

getIdleTimeOut

public int getIdleTimeOut()
(no effect now, WAS use WebSphere Administrative Console to configure) Gets the number of seconds that a connection should remain unused in the pool. After idle time out, the connection will be disconnected & destroyed.
Specified by:
getIdleTimeOut in interface dkPool
Returns:
the number of seconds

setIdleTimeOut

public void setIdleTimeOut(int idleTime)
                    throws DKException,
                           java.lang.Exception
(no effect now, WAS use WebSphere Administrative Console to configure) Sets the number of seconds that a connection should remain unused in the pool before the connection is disconnect & destroyed.
Specified by:
setIdleTimeOut in interface dkPool
Parameters:
idleTime - the number of seconds

getConnTimeOut

public int getConnTimeOut()
(no effect now, WAS use WebSphere Administrative Console to configure) Gets the number of seconds that an application waits for a connection from the pool before time out and throwing exception.
Specified by:
getConnTimeOut in interface dkPool
Returns:
the number of seconds

setConnTimeOut

public void setConnTimeOut(int connTime)
                    throws DKException,
                           java.lang.Exception
(no effect now, WAS use WebSphere Administrative Console to configure) Sets the number of seconds that an application waits for a connection from the pool before time out and throwing exception.
Specified by:
setConnTimeOut in interface dkPool
Parameters:
connTime - the number of seconds

getOrphanTimeOut

public int getOrphanTimeOut()
(no effect now, WAS use WebSphere Administrative Console to configure) Gets the number of seconds that an application is allowed to hold an inactive connection.
Specified by:
getOrphanTimeOut in interface dkPool
Returns:
the number of seconds

setOrphanTimeOut

public void setOrphanTimeOut(int orphanTime)
                      throws DKException,
                             java.lang.Exception
(no effect now, WAS use WebSphere Administrative Console to configure) Sets the number of seconds that an application is allowed to hold an inactive connection. 0(zero) indicates no inactive connection time out.
Specified by:
setOrphanTimeOut in interface dkPool
Parameters:
orphanTime - the number of seconds (this is not implemented for WAS. Use WebSphere Adm. Console to configure this.

getConnection

public DKHandle getConnection(java.lang.String userId,
                              java.lang.String passwd)
                       throws DKException,
                              java.lang.Exception
Gets a connection from the pool
Specified by:
getConnection in interface dkPool
Parameters:
userId - the user name used for connection
passwd - the password used for connection
Returns:
a DKHandle that contains the Connection object

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


returnConnection

public void returnConnection(DKHandle handle)
                      throws DKException,
                             java.lang.Exception
Returns a connection to the pool
Specified by:
returnConnection in interface dkPool
Parameters:
handle - a DKHandle that contains the Connection object

initConnections

public void initConnections(java.lang.String userId,
                            java.lang.String passwd,
                            int initSize)
                     throws DKException,
                            java.lang.Exception
(no effect now, WAS use WebSphere Administrative Console to configure) Initialize number of connections and store them in the pool
Specified by:
initConnections in interface dkPool
Parameters:
userId - the user Id used for connection
passwd - the password used for connection
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
Specified by:
destroy in interface dkPool

poolConnectType

public java.lang.String poolConnectType()
                                 throws java.lang.Exception
Gets the pool connect type for this connection pool For ICM in java, this will be JDBC
Specified by:
poolConnectType in interface dkPool
Returns:
pool connection type

EIP Java APIs

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