org.openeai.dbpool
Class EnterprisePooledConnection


java.lang.Object

  |

  +--org.openeai.OpenEaiObject

        |

        +--org.openeai.dbpool.EnterpriseDbConnectionObject

              |

              +--org.openeai.dbpool.EnterprisePooledConnection


public class EnterprisePooledConnection
extends EnterpriseDbConnectionObject

This is the actual java.sql.Connection that is stored in the EnterpriseConnectionPool.

Version:
3.0 beta2 - 28 January 2003
Author:
Tod Jackson (tod@openeai.org), Steve Wheat (steve@openeai.org)

Field Summary
 
Fields inherited from class org.openeai.OpenEaiObject
logger
 
Constructor Summary
EnterprisePooledConnection(java.lang.String poolName, java.lang.String driverName, java.lang.String connString, java.lang.String connUserId, java.lang.String connUserPassword, java.lang.String verifyString)
          Constructor
 
Method Summary
 java.sql.Connection getConnection()
          Returns the java.sql.Connection object associated to this pooled connection.
 long getConnectionId()
           
 boolean isInuse()
          Returns a flag indicating whether or not this connection is in use.
 void setConnection(java.sql.Connection conn)
          Sets the java.sql.Connection object associated to this pooled connection object.
 void setConnectionId(long id)
           
 void setInuse(boolean inUse)
          Sets a flag indicating whether or not this connection is in use.
 
Methods inherited from class org.openeai.dbpool.EnterpriseDbConnectionObject
getConnectPassword, getConnectString, getConnectUserId, getDriverName, getPoolName, getVerificationQueryString, setConnectPassword, setConnectString, setConnectUserId, setDriverName, setPoolName, setVerificationQueryString
 
Methods inherited from class org.openeai.OpenEaiObject
addLog4jProperty, getAppName, getDebug, getFromAddr, getLog4jProperties, getMailHost, getMailService, getProperties, getToAddr, initializeLog4j, initializeLog4j, initializeLog4j, setAppName, setDebug, setFromAddr, setMailHost, setMailService, setProperties, setToAddr
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EnterprisePooledConnection


public EnterprisePooledConnection(java.lang.String poolName,
                                  java.lang.String driverName,
                                  java.lang.String connString,
                                  java.lang.String connUserId,
                                  java.lang.String connUserPassword,
                                  java.lang.String verifyString)
                           throws java.sql.SQLException
Constructor

Method Detail

setInuse


public void setInuse(boolean inUse)
Sets a flag indicating whether or not this connection is in use.


isInuse


public boolean isInuse()
Returns a flag indicating whether or not this connection is in use.


setConnectionId


public void setConnectionId(long id)

getConnectionId


public long getConnectionId()

getConnection


public java.sql.Connection getConnection()
                                  throws java.sql.SQLException
Returns the java.sql.Connection object associated to this pooled connection. Before returning the connection though, it verifies that the connection is still in tact by testing the isClosed method of the connection as well as invoking any verification string associated to the connection. If either of these two operations cannot be successfully completed, it will attempt to re-establish the connection with the database before returning. If the connection cannot be successfully re-established, it will throw an exception.

Returns:
java.sql.Connection
Throws:
java.sql.SQLException - if errors occur re-establishing the connection with the database.

setConnection


public void setConnection(java.sql.Connection conn)
Sets the java.sql.Connection object associated to this pooled connection object. This connection will be established when the EnterprsieConnectionPool instantiates this pooled connection object passing all the necessary information to establish the connection.



Copyright © 2002, OpenEAI Software Foundation