com.bankframe.ei.txnhandler.connector.jdbcconnector
Class JDBCConnectionPool

java.lang.Object
  extended by com.bankframe.ei.txnhandler.connector.jdbcconnector.JDBCConnectionPool
All Implemented Interfaces:
Serializable

public class JDBCConnectionPool
extends Object
implements Serializable

This class is a Connection Pool for the JDBC Connector. It stores and manages a series of physical (EManaged) connections to the offline database.

See Also:
Serialized Form

Constructor Summary
JDBCConnectionPool(String s, int i, int j)
          JDBCConnectionPool constructor
 
Method Summary
 void addConnection(EManagedConnection emanagedconnection)
          This method adds a connection to the pool of available connections.
 void freeConnection(EManagedConnection emanagedconnection)
          This method frees (makes available for use) a connection in the pool that was currently in use.
 EManagedConnection getConnection(EManagedConnectionFactory emanagedconnectionfactory, String s)
          This method gets a managed connection from the pool.
 Set getFreeConnections()
          This method returns the Set of free connections available in the pool.
 String getName()
          This method gets the name of this pool.
 void release()
          This method releases all existing free connections in the Connection Pool.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JDBCConnectionPool

public JDBCConnectionPool(String s,
                          int i,
                          int j)
JDBCConnectionPool constructor

Parameters:
s - String name The name of the Pool to be created.
i - int maxConns The maximum connections allowable.
j - int timeOut The max amount of time to wait for a connection that is not available.
Method Detail

addConnection

public void addConnection(EManagedConnection emanagedconnection)
This method adds a connection to the pool of available connections.

Parameters:
emanagedconnection - The connection to add to the pool.

freeConnection

public void freeConnection(EManagedConnection emanagedconnection)
This method frees (makes available for use) a connection in the pool that was currently in use.

Parameters:
emanagedconnection - EManagedConnection The connection to free in the pool.

getConnection

public EManagedConnection getConnection(EManagedConnectionFactory emanagedconnectionfactory,
                                        String s)
                                 throws SQLException
This method gets a managed connection from the pool. If no matching connections are available, and we haven't reached the maximum, then a new connection will be created.

Parameters:
emanagedconnectionfactory - The EManagedConnectionFactory for creation of a new connection if necessary.
s - A String of semi-colon delimited property values to be associated with this connection.
Returns:
An EManagedConnection to access MQSeries.
Throws:
SQLException

getFreeConnections

public Set getFreeConnections()
This method returns the Set of free connections available in the pool.

Returns:
A Set of free connections.

getName

public String getName()
This method gets the name of this pool.

Returns:
The name of this pool.

release

public void release()
This method releases all existing free connections in the Connection Pool. i.e. they are physically closed and no longer available for use.



Copyright © 2005, 2007, Oracle. All rights reserved.