org.openeai.dbpool
Class EnterpriseDbConnectionObject

java.lang.Object
  extended by org.openeai.OpenEaiObject
      extended by org.openeai.dbpool.EnterpriseDbConnectionObject
Direct Known Subclasses:
EnterpriseConnectionPool, EnterprisePooledConnection

public abstract class EnterpriseDbConnectionObject
extends OpenEaiObject

A class that is stored in the EnterpriseConnectionPool. This class contains all the information the pool needs to instantiate a java.sql.Connection object that it stores in the pool. This is a convenience class that allows both the EnterpriseConnectionPool and the EnterprisePooledConnection to inherit some convenience methods that they both share.

Version:
3.0 - 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
EnterpriseDbConnectionObject()
           
 
Method Summary
 java.lang.String getConnectPassword()
          Returns the password for the databse user to be used to establish the connection.
 java.lang.String getConnectString()
          Returns the connection string associated to this connection.
 java.lang.String getConnectUserId()
          Returns the database user id to be used to establish the connection.
 java.lang.String getDriverName()
          Returns the database driver name that should be used to establish a connection.
 java.lang.String getPoolName()
          Returns the name of the pool to which this object is associated.
 java.lang.String getVerificationQueryString()
          Returns the verification string associated to this connection.
 void setConnectPassword(java.lang.String connectPassword)
          Sets the password for the databse user to be used to establish the connection.
 void setConnectString(java.lang.String connectString)
          Sets the connect string associated to this connection as specified in the configuration document.
 void setConnectUserId(java.lang.String connectUserId)
          Sets the database user id to be used to establish the connection.
 void setDriverName(java.lang.String driverName)
          Sets the database driver name that should be used to establish a connection.
 void setPoolName(java.lang.String poolName)
          Sets the name of the pool to which this object is associated.
 void setVerificationQueryString(java.lang.String verifyString)
          Sets the verification string that will be used to test a connection prior to returning if from the pool.
 
Methods inherited from class org.openeai.OpenEaiObject
getAppName, getDebug, getFromAddr, 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

EnterpriseDbConnectionObject

public EnterpriseDbConnectionObject()
Method Detail

setPoolName

public void setPoolName(java.lang.String poolName)
Sets the name of the pool to which this object is associated.

Parameters:
poolName - String the name of the pool

getPoolName

public java.lang.String getPoolName()
Returns the name of the pool to which this object is associated.

Returns:
String the name of the pool.

setDriverName

public void setDriverName(java.lang.String driverName)
                   throws java.lang.NullPointerException
Sets the database driver name that should be used to establish a connection.

Example: com.sybase.jdbc2.jdbc.SybDriver

Parameters:
driverName - String the database driver name
Throws:
java.lang.NullPointerException - if the driver name is null or empty.
See Also:
Connection

getDriverName

public java.lang.String getDriverName()
Returns the database driver name that should be used to establish a connection.

Returns:
String the database driver name

setVerificationQueryString

public void setVerificationQueryString(java.lang.String verifyString)
Sets the verification string that will be used to test a connection prior to returning if from the pool. This information is specified in the DbConnectionPoolConfig Element/Object. Since not all JDBC drivers support the isClosed method, this extra check is needed to ensure the connection is still in tact. If no verification string is specified, the pool will simply use the isClosed method to determine if the connection is in tact prior to returning it.

Examples of verification strings:

If the driver specified is an Oracle driver, the foundation will default to a robust verification string that tests the connection ("declare x number; begin x:=1; end;"). However, this can be overridden if the information is specified in the configuration document.

Parameters:
verifyString - String the string to use to verify the connection.

getVerificationQueryString

public java.lang.String getVerificationQueryString()
Returns the verification string associated to this connection.

Returns:
String the verification string.

setConnectString

public void setConnectString(java.lang.String connectString)
                      throws java.lang.NullPointerException
Sets the connect string associated to this connection as specified in the configuration document.

Example: jdbc:sybase:Tds:ahost.or.ip.com:5000

Parameters:
connectString - String connection string.
Throws:
java.lang.NullPointerException
See Also:
Connection

getConnectString

public java.lang.String getConnectString()
Returns the connection string associated to this connection.

Returns:
String
See Also:
Connection

setConnectUserId

public void setConnectUserId(java.lang.String connectUserId)
                      throws java.lang.NullPointerException
Sets the database user id to be used to establish the connection.

Parameters:
connectUserId - String the database user id.
Throws:
java.lang.NullPointerException

getConnectUserId

public java.lang.String getConnectUserId()
Returns the database user id to be used to establish the connection.

Returns:
String

setConnectPassword

public void setConnectPassword(java.lang.String connectPassword)
                        throws java.lang.NullPointerException
Sets the password for the databse user to be used to establish the connection.

Parameters:
connectPassword - String the password of the database user.
Throws:
java.lang.NullPointerException

getConnectPassword

public java.lang.String getConnectPassword()
Returns the password for the databse user to be used to establish the connection.

Returns:
String the password of the database user.


Copyright © 2002,2003 OpenEAI Software Foundation