public class IfxConnectionPoolDataSource extends IfxCoreDataSource implements javax.sql.ConnectionPoolDataSource, javax.naming.Referenceable
IfxConnectionPoolDataSource is the Informix implemenation of javax.sql.ConnectionPoolDataSource. This class is embedded in the datasource that implements connection pooling.
DataSource
,
ConnectionPoolDataSource
,
IfxCoreDataSource
,
Serialized FormdirectConnection, DSProperties
Constructor and Description |
---|
IfxConnectionPoolDataSource()
Allocates an empty IfxConnectionPoolDataSource object
|
Modifier and Type | Method and Description |
---|---|
protected void |
addToReferenceList(IfxPooledConnection conn)
Add the connection to reference list
|
boolean |
checkIsDirect()
checkIsDirect -- check if the protocol is DirectProtocol once per CPDS
|
protected void |
checkMaxConnections()
enforce IFMX_CPM_MAX_CONNECTIONS
This is NOT synchronized; you may have to do so if necessary.
|
protected int |
getConnectionCount()
get the count of connections allocated by the "DB server".
|
long |
getIfxCPMAgeLimit()
Gets the life span of a connection in the Pool .
|
int |
getIfxCPMInitPoolSize()
gets the initial number of connections to preallocate for the Pool
Default is 0.
|
int |
getIfxCPMMaxConnections()
gets the limit for the maximum number of connections
Default is -1, meaning no limit restriction.
|
int |
getIfxCPMMaxPoolSize()
gets the high water mark for the Pool.
|
long |
getIfxCPMMinAgeLimit()
Gets the ageLimit for connections under the minimum level
Default is -1, means it lives indefinitely
0, means it lives as long as the other free connections
|
int |
getIfxCPMMinPoolSize()
get the minimum connections to maintain in the Pool.
|
long |
getIfxCPMServiceInterval()
Gets the Pool service interval in milliseconds.
|
boolean |
getIfxCPMSwitchHDRPool()
Gets the HDR Pool enabled/disabled value as boolean.
|
int |
getInitialPoolSize()
get initialPoolSize
|
int |
getMaxIdleTime()
get maxIdleTime
|
int |
getMaxPoolSize()
get maxPoolSize
|
int |
getMaxStatements()
getMaxStatements returns 0 always.
|
int |
getMinPoolSize()
get minPoolSize
|
java.util.logging.Logger |
getParentLogger() |
javax.sql.PooledConnection |
getPooledConnection()
Attempt to establish a database connection.
|
javax.sql.PooledConnection |
getPooledConnection(java.lang.String luser,
java.lang.String lpassword)
Attempt to establish a database connection.
|
javax.sql.PooledConnection |
getPooledConnection(java.lang.String luser,
java.lang.String lpassword,
IfxConnectionEventListener listener)
Attempt to establish a database connection.
|
int |
getPropertyCycle()
getPropertyCycle returns IFMX_CPM_SERVICE_INTERVAL value.
|
javax.naming.Reference |
getReference()
Make a reference to this IfxConnectionPooledDataSource.
|
java.lang.reflect.Constructor<?> |
getReUsableCons()
getReUsableCons -- get the directReUsableConstructor
|
protected void |
removeFromReferenceList(IfxPooledConnection conn)
Remove connection from the reference list
|
void |
setIfxCPMAgeLimit(long ageLimit)
Sets the property IFMX_CPM_AGELIMIT
The value limits the life of a connection in the pool.
|
void |
setIfxCPMInitPoolSize(int init)
Sets the property IFMX_CPM_INIT_POOLSIZE
The value is the initial number of connections to preallocate
for the Pool.
|
void |
setIfxCPMMaxConnections(int limit)
Sets the property IFMX_CPM_MAX_CONNECTIONS
The value is the maximum limit to the total number
of Server connections for the Connection Pool Datasource.
|
void |
setIfxCPMMaxPoolSize(int max)
Sets the property IFMX_CPM_MAX_POOLSIZE
The value is the high-water mark for the Pool.
|
void |
setIfxCPMMinAgeLimit(long ageLimit) |
void |
setIfxCPMMinPoolSize(int min)
Sets the property IFMX_CPM_MIN_POOLSIZE
The value is the minimum number of connections to maintain in
the free Pool.
|
void |
setIfxCPMServiceInterval(long interval) |
void |
setIfxCPMSwitchHDRPool(boolean hdrFlag)
Sets the property IFMX_CPM_ENABLE_SWITCH_HDR_POOL
To enable/diable automatic switching between the HDR pools
|
void |
setInitialPoolSize(int init)
sets initialPoolSize
|
void |
setMaxIdleTime(int ageLimit)
set maxIdleTime
|
void |
setMaxPoolSize(int max)
set maxPoolSize
|
void |
setMaxStatements(int limit)
setMaxStatements ignores call or noop
|
void |
setMinPoolSize(int min)
set minPoolSize
JDBC3.0 compliance
|
void |
setPropertyCycle(int cyc)
setPropertyCycle ignores call or noop.
|
void |
setReUsableCons(java.lang.reflect.Constructor<?> cons)
setReUsableCons -- set the directReUsableConstructor
|
addProp, getDatabaseName, getDataSourceName, getDescription, getDsProperties, getIfxALLOWREGISTEROUTFORINPARAM, getIfxAPPENDISAM, getIfxBIG_FET_BUF_SIZE, getIfxCLIENT_LOCALE, getIfxCSM, getIfxDB_LOCALE, getIfxDBCENTURY, getIfxDBDATE, getIfxDBSPACETEMP, getIfxDBTEMP, getIfxDBTIME, getIfxDBUPSPACE, getIfxENABLE_HDRSWITCH, getIfxFET_BUF_SIZE, getIfxGL_DATE, getIfxGL_DATETIME, getIfxIFX_BATCHUPDATE_PER_SPEC, getIfxIFX_CODESETLOB, getIfxIFX_DIRECTIVES, getIfxIFX_EXTDIRECTIVES, getIfxIFX_FLAT_UCSQ, getIfxIFX_GET_SMFLOAT_AS_FLOAT, getIfxIFX_ISOLATION_LEVEL, getIfxIFX_LO_READONLY, getIfxIFX_LOCK_MODE_WAIT, getIfxIFX_PAD_VARCHAR, getIfxIFX_SET_FLOAT_AS_SMFLOAT, getIfxIFX_SOC_KEEPALIVE, getIfxIFX_SOC_TIMEOUT, getIfxIFX_TRIMTRAILINGSPACES, getIfxIFX_USE_STRENC, getIfxIFXHOST_SECONDARY, getIfxIFXHOST, getIfxINFORMIXCONRETRY, getIfxINFORMIXCONTIME, getIfxINFORMIXOPCACHE, getIfxINFORMIXSERVER_SECONDARY, getIfxINFORMIXSTACKSIZE, getIfxJDBCTEMP, getIfxLDAP_IFXBASE, getIfxLDAP_PASSWD, getIfxLDAP_URL, getIfxLDAP_USER, getIfxLOBCACHE, getIfxNEWCODESET, getIfxNEWLOCALE, getIfxNEWNLSMAP, getIfxNODEFDAC, getIfxOPT_GOAL, getIfxOPTCOMPIND, getIfxOPTOFC, getIfxPATH, getIfxPDQPRIORITY, getIfxPLCONFIG, getIfxPLOAD_LO_PATH, getIfxPORTNO_SECONDARY, getIfxPROTOCOLTRACE, getIfxPROTOCOLTRACEFILE, getIfxPROXY, getIfxPSORT_DBTEMP, getIfxPSORT_NPROCS, getIfxSECURITY, getIfxSQLH_FILE, getIfxSQLH_LOC, getIfxSQLH_TYPE, getIfxSQLIDEBUG, getIfxSSL_PROTOCOLS, getIfxSSLCONNECTION, getIfxSTMT_CACHE, getIfxTRACE, getIfxTRACEFILE, getIfxTRUSTED_CONTEXT, getLoginTimeout, getLogWriter, getPassword, getPortNumber, getProp, getRoleName, getServerName, getUser, isIfxDBANSIWARN, isIfxDELIMIDENT, isIfxENABLE_TYPE_CACHE, isIfxIFX_AUTOFREE, isIfxIFX_USEPUT, isIfxOPTOFC, isIfxUSE_DTENV, isIfxUSEV5SERVER, readProperties, removeProperty, setAutoCaseSchema, setCursorHoldability, setDatabaseName, setDataSourceName, setDescription, setIfxALLOWREGISTEROUTFORINPARAM, setIfxAPPENDISAM, setIfxBIG_FET_BUF_SIZE, setIfxCLIENT_LOCALE, setIfxCSM, setIfxDB_LOCALE, setIfxDBANSIWARN, setIfxDBCENTURY, setIfxDBDATE, setIfxDBSPACETEMP, setIfxDBTEMP, setIfxDBTIME, setIfxDBUPSPACE, setIfxDELIMIDENT, setIfxDirectConnection, setIfxENABLE_HDRSWITCH, setIfxENABLE_TYPE_CACHE, setIfxFET_BUF_SIZE, setIfxGL_DATE, setIfxGL_DATETIME, setIfxIFX_AUTOFREE, setIfxIFX_BATCHUPDATE_PER_SPEC, setIfxIFX_CODESETLOB, setIfxIFX_DIRECTIVES, setIfxIFX_EXTDIRECTIVES, setIfxIFX_FLAT_UCSQ, setIfxIFX_GET_SMFLOAT_AS_FLOAT, setIfxIFX_ISOLATION_LEVEL, setIfxIFX_LO_READONLY, setIfxIFX_LOCK_MODE_WAIT, setIfxIFX_PAD_VARCHAR, setIfxIFX_SET_FLOAT_AS_SMFLOAT, setIfxIFX_SOC_KEEPALIVE, setIfxIFX_SOC_TIMEOUT, setIfxIFX_TRIMTRAILINGSPACES, setIfxIFX_USE_STRENC, setIfxIFX_USEPUT, setIfxIFXHOST_SECONDARY, setIfxIFXHOST, setIfxINFORMIXCONRETRY, setIfxINFORMIXCONTIME, setIfxINFORMIXOPCACHE, setIfxINFORMIXSERVER_SECONDARY, setIfxINFORMIXSTACKSIZE, setIfxJDBCTEMP, setIfxLDAP_IFXBASE, setIfxLDAP_PASSWD, setIfxLDAP_URL, setIfxLDAP_USER, setIfxLOBCACHE, setIfxNEWCODESET, setIfxNEWLOCALE, setIfxNEWNLSMAP, setIfxNODEFDAC, setIfxOPT_GOAL, setIfxOPTCOMPIND, setIfxOPTOFC, setIfxPATH, setIfxPDQPRIORITY, setIfxPLCONFIG, setIfxPLOAD_LO_PATH, setIfxPORTNO_SECONDARY, setIfxPROTOCOLTRACE, setIfxPROTOCOLTRACEFILE, setIfxPROXY, setIfxPSORT_DBTEMP, setIfxPSORT_NPROCS, setIfxSECURITY, setIfxSQLH_FILE, setIfxSQLH_LOC, setIfxSQLH_TYPE, setIfxSQLIDEBUG, setIfxSSL_PROTOCOLS, setIfxSSLCONNECTION, setIfxSTMT_CACHE, setIfxTRACE, setIfxTRACEFILE, setIfxTRUSTED_CONTEXT, setIfxUSE_DTENV, setIfxUSEV5SERVER, setLoginTimeout, setLogWriter, setMetadataUppercaseValues, setPassword, setPortNumber, setRoleName, setServerName, setTrustStore, setTrustStorePassword, setUser, toString, writeProperties
public IfxConnectionPoolDataSource()
Allocates an empty IfxConnectionPoolDataSource object
public void setReUsableCons(java.lang.reflect.Constructor<?> cons)
setReUsableCons -- set the directReUsableConstructor
public java.lang.reflect.Constructor<?> getReUsableCons()
getReUsableCons -- get the directReUsableConstructor
public javax.sql.PooledConnection getPooledConnection() throws java.sql.SQLException
Attempt to establish a database connection.
getPooledConnection
in interface javax.sql.ConnectionPoolDataSource
java.sql.SQLException
- if a database-access error occurs.
NEVER USEDpublic javax.sql.PooledConnection getPooledConnection(java.lang.String luser, java.lang.String lpassword) throws java.sql.SQLException
Attempt to establish a database connection.
getPooledConnection
in interface javax.sql.ConnectionPoolDataSource
user
- the database user on whose behalf the Connection is being madepassword
- the user's passwordjava.sql.SQLException
- if a database-access error occurs.
DOES NOT APPEAR TO BE USEDpublic javax.sql.PooledConnection getPooledConnection(java.lang.String luser, java.lang.String lpassword, IfxConnectionEventListener listener) throws java.sql.SQLException
Attempt to establish a database connection.
user
- the database user on whose behalf the Connection is being madepassword
- the user's passwordIfxConnectionEventListener
- java.sql.SQLException
- if a database-access error occurs.protected void checkMaxConnections() throws java.sql.SQLException
enforce IFMX_CPM_MAX_CONNECTIONS This is NOT synchronized; you may have to do so if necessary.
java.sql.SQLException
- ifprotected void addToReferenceList(IfxPooledConnection conn)
Add the connection to reference list
PooledConnection
- object to be added to the listprotected void removeFromReferenceList(IfxPooledConnection conn)
Remove connection from the reference list
PooledConnection
- object to be removed from the listprotected int getConnectionCount()
get the count of connections allocated by the "DB server". Note: be aware that multiple client threads may be running asynchronously to get or close connections! You will have to block them if necessary.
public javax.naming.Reference getReference() throws javax.naming.NamingException
Make a reference to this IfxConnectionPooledDataSource. (see similar comments in IfxDataSource)
getReference
in interface javax.naming.Referenceable
javax.naming.NamingException
- if error occurs in getting the reference.public void setIfxCPMMaxConnections(int limit)
Sets the property IFMX_CPM_MAX_CONNECTIONS The value is the maximum limit to the total number of Server connections for the Connection Pool Datasource. This total is the sum of the connections in the free Pool, plus those that are in-use and not closed by the application.
limit
- is the maximum connections allowed for the CPDS .public void setMaxStatements(int limit) throws java.sql.SQLException
java.sql.SQLException
public int getIfxCPMMaxConnections()
gets the limit for the maximum number of connections Default is -1, meaning no limit restriction.
public int getMaxStatements() throws java.sql.SQLException
java.sql.SQLException
public void setIfxCPMInitPoolSize(int init)
Sets the property IFMX_CPM_INIT_POOLSIZE The value is the initial number of connections to preallocate for the Pool.
init
- is the number of initial connectionspublic void setInitialPoolSize(int init)
sets initialPoolSize
public int getIfxCPMInitPoolSize()
gets the initial number of connections to preallocate for the Pool Default is 0.
public int getInitialPoolSize()
get initialPoolSize
public void setIfxCPMMaxPoolSize(int max)
Sets the property IFMX_CPM_MAX_POOLSIZE The value is the high-water mark for the Pool. When the number of connections exceed this number, any closed connection will be returned to server instead of being recycled.
max
- is the maximum connections to keep in the Pool.public void setMaxPoolSize(int max)
set maxPoolSize
public int getIfxCPMMaxPoolSize()
gets the high water mark for the Pool. Default is 100.
public int getMaxPoolSize()
get maxPoolSize
public void setIfxCPMMinPoolSize(int min)
Sets the property IFMX_CPM_MIN_POOLSIZE The value is the minimum number of connections to maintain in the free Pool. When the number of connections fall below this minumum, a background the Pool Service thread will fill it up at a specified rate (see IfxCPMServiceInterval).
min
- is the minimum connections to maintain in the Pool.public void setMinPoolSize(int min)
public int getIfxCPMMinPoolSize()
get the minimum connections to maintain in the Pool. Default is 0, means the Pool can be empty.
public int getMinPoolSize()
get minPoolSize
public void setIfxCPMMinAgeLimit(long ageLimit)
public long getIfxCPMMinAgeLimit()
Gets the ageLimit for connections under the minimum level Default is -1, means it lives indefinitely 0, means it lives as long as the other free connections
public void setIfxCPMAgeLimit(long ageLimit)
Sets the property IFMX_CPM_AGELIMIT The value limits the life of a connection in the pool.
ageLimit
- is the time in seconds.public void setMaxIdleTime(int ageLimit)
set maxIdleTime
public long getIfxCPMAgeLimit()
Gets the life span of a connection in the Pool . Default is -1, means indefinitely
public int getMaxIdleTime()
get maxIdleTime
public void setPropertyCycle(int cyc) throws java.sql.SQLException
java.sql.SQLException
public int getPropertyCycle() throws java.sql.SQLException
java.sql.SQLException
public void setIfxCPMServiceInterval(long interval)
public long getIfxCPMServiceInterval()
Gets the Pool service interval in milliseconds. Default is 100 milliseconds.
public void setIfxCPMSwitchHDRPool(boolean hdrFlag)
Sets the property IFMX_CPM_ENABLE_SWITCH_HDR_POOL To enable/diable automatic switching between the HDR pools
boolean
- flag to set the value.public boolean getIfxCPMSwitchHDRPool()
Gets the HDR Pool enabled/disabled value as boolean. Default is FALSE.
public boolean checkIsDirect()
checkIsDirect -- check if the protocol is DirectProtocol once per CPDS
public java.util.logging.Logger getParentLogger() throws java.sql.SQLFeatureNotSupportedException
getParentLogger
in interface javax.sql.CommonDataSource
java.sql.SQLFeatureNotSupportedException