Enterprise Information Portal APIs

com.ibm.mm.sdk.common
Interface dkPool

All Known Implementing Classes:
DKPoolJDBC, DKPoolWAS

public interface dkPool

dkPool: An interface for database connection pool. A dkPool object is a factory for database Connection objects


Method Summary
 void destroy()
          Destroy this dkPool object including all connections in both free pool and used pool
 java.lang.String getConfigurationString()
          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()
          Gets the number of seconds that an application waits for a connection from the pool before time out and throwing exception.
 int getIdleTimeOut()
          Gets the number of seconds that a connection should remain unused in the pool.
 int getMaxPoolSize()
          Gets the maximum number of connections that the pool should contain.
 int getMinPoolSize()
          Gets the minimum number of connections that the pool should keep when all the connections are idle.
 int getOrphanTimeOut()
          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 server name.
 void initConnections(java.lang.String userid, java.lang.String passwd, int initSize)
          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_DB2" or "WAS"
 void returnConnection(DKHandle handle)
          Returns a connection to the pool
 void setConfigurationString(java.lang.String configString)
          Sets the configuration string which supplies the specific initialization parameters for connection.
 void setConnTimeOut(int connTime)
          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)
          Sets the number of seconds that a connection should remain unused in the pool before the connection is disconnect & destroyed.
 void setMaxPoolSize(int poolSize)
          Sets the maximum number of connections that the pool should contain.
 void setMinPoolSize(int poolSize)
          Sets the minimum number of connections that the pool should keep when all connections are idle.
 void setOrphanTimeOut(int orphanTime)
          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 server name.
 

Method Detail

getServerName

public java.lang.String getServerName()
Gets the name of the data source's server name. For JDBC pool, this is the url. For WebSphere, this is the DataSource name bound in the JNDI namespace
Returns:
the data source server name

setServerName

public void setServerName(java.lang.String aDSName)
                   throws DKException,
                          java.lang.Exception
Sets the name of the data source's server name. For JDBC pool, this is the url. For WebSphere, this is the DataSource name bound in the JNDI namespace Once the connection has been created, you can not set this to a different name
Parameters:
aDSName - the name for creating connection

getConfigurationString

public java.lang.String getConfigurationString()
Gets the configuration string which supplies the specific initialization parameters for connection. For JDBC, this is the driver name. Example of JDBC driver name are:

Returns:
the configuration information

setConfigurationString

public void setConfigurationString(java.lang.String configString)
                            throws DKException,
                                   java.lang.Exception
Sets the configuration string which supplies the specific initialization parameters for connection. For JDBC, this is the driver name. Example of JDBC driver name are:

Once the connection has been created, you can not set this to a different configuration string

Parameters:
configString - info about connection driver

getMaxPoolSize

public int getMaxPoolSize()
Gets the maximum number of connections that the pool should contain. 0(zero) indicates no maximum size (unlimited)
Returns:
the maximum number of connection pool size (this is not implemented for WAS. Use WebSphere Adm. Console to configure this.

setMaxPoolSize

public void setMaxPoolSize(int poolSize)
                    throws DKException,
                           java.lang.Exception
Sets the maximum number of connections that the pool should contain. 0(zero) indicates no maximum size (unlimited). Once the connection has been created, you can not set this to a different number
Parameters:
poolSize - the maximum number of connection pool size (this is not implemented for WAS. Use WebSphere Adm. Console to configure this.

getMinPoolSize

public int getMinPoolSize()
Gets the minimum number of connections that the pool should keep when all the connections are idle. 0(zero) indicates the connections should be created as needed.
Returns:
the minimum number of connection pool size (this is not implemented for WAS. Use WebSphere Adm. Console to configure this.

setMinPoolSize

public void setMinPoolSize(int poolSize)
                    throws DKException,
                           java.lang.Exception
Sets the minimum number of connections that the pool should keep when all connections are idle. 0(zero) indicates the connections should be created as needed. Once the connection has been created & connected, you can not set this to a different number
Parameters:
poolSize - the minimum number of connection pool size (this is not implemented for WAS. Use WebSphere Adm. Console to configure this.

getIdleTimeOut

public int getIdleTimeOut()
Gets the number of seconds that a connection should remain unused in the pool. After idle time out, the connection will be disconnected & destroyed. 0(zero) indicates no limit.
Returns:
the number of seconds (this is not implemented for WAS. Use WebSphere Adm. Console to configure this.

setIdleTimeOut

public void setIdleTimeOut(int idleTime)
                    throws DKException,
                           java.lang.Exception
Sets the number of seconds that a connection should remain unused in the pool before the connection is disconnect & destroyed. 0(zero) indicates no limit.
Parameters:
idleTime - the number of seconds (this is not implemented for WAS. Use WebSphere Adm. Console to configure this.

getConnTimeOut

public int getConnTimeOut()
Gets the number of seconds that an application waits for a connection from the pool before time out and throwing exception. 0(zero) indicates no wait.
Returns:
the number of seconds (this is not implemented for WAS. Use WebSphere Adm. Console to configure this.

setConnTimeOut

public void setConnTimeOut(int connTime)
                    throws DKException,
                           java.lang.Exception
Sets the number of seconds that an application waits for a connection from the pool before time out and throwing exception. 0(zero) indicates no wait.
Parameters:
connTime - the number of seconds (this is not implemented for WAS. Use WebSphere Adm. Console to configure this.

getOrphanTimeOut

public int getOrphanTimeOut()
Gets the number of seconds that an application is allowed to hold an inactive connection. 0(zero) indicates no inactive connection time out.
Returns:
the number of seconds (this is not implemented for WAS. Use WebSphere Adm. Console to configure this.

setOrphanTimeOut

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

initConnections

public void initConnections(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:
userId - the user Id used for connection
passwd - the password used for connection
initSize - the number of connection to be created

getConnection

public DKHandle getConnection(java.lang.String userId,
                              java.lang.String passwd)
                       throws DKException,
                              java.lang.Exception
Gets a connection from the pool
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
Parameters:
handle - a DKHandle that contains the Connection object

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_DB2" or "WAS"
Returns:
pool connection type

destroy

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

EIP Java APIs

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