BEA Systems, Inc.

WebLogic Server 6.1 API Reference

weblogic.management.configuration
Interface JDBCConnectionPoolMBean


public interface JDBCConnectionPoolMBean
extends DeploymentMBean

This bean defines a JDBC connection pool.

Author:
Copyright (c) 2000, 2001 by BEA Systems, Inc. All Rights Reserved.
Copyright © 2001 BEA Systems, Inc. All Rights Reserved.

Fields inherited from class weblogic.management.configuration.DeploymentMBean
DEFAULT_ORDER, MAX_ORDER, MIN_ORDER
 
Method Summary
 java.lang.String getACLName()
          Returns the ACL used to control access to this Connection Pool.
 int getCapacityIncrement()
          Returns the increment by which the pool capacity is expanded.
 java.lang.String getDriverName()
          Returns the full package name of the JDBC 2-tier driver class used to create the physical connections between the WebLogic Server and the DBMS for this Connection Pool.
 int getInitialCapacity()
          Returns number of physical database connections to create when creating the pool.
 int getLoginDelaySeconds()
          Return number of seconds to delay before creating each physical database connection.
 int getMaxCapacity()
          Returns the maximum number of physical database connections that this Connection Pool can contain.
 java.lang.String getPassword()
          Password attribute If set, this value overrides any password defined in the Properties passed to the tier-2 JDBC Driver when creating physical database connections.
 int getPreparedStatementCacheSize()
          Returns size of the prepared statement cache.
 java.util.Properties getProperties()
          Returns the list of properties passed to the the 2-tier JDBC Driver to use when creating physical database connections.
 int getRefreshMinutes()
          Get the connection refresh interval
 int getShrinkPeriodMinutes()
          Get the number of minutes to wait before shrinking a connection pool that has incrementally increased to meet demand.
 boolean getSupportsLocalTransaction()
           
 boolean getTestConnectionsOnRelease()
          When set to true, the WebLogic Server tests a connection before returning it to the connection pool.
 boolean getTestConnectionsOnReserve()
          When set to true, the WebLogic Server tests a connection before giving it to the client.
 java.lang.String getTestTableName()
          Gets the name of the table that will be used when testing a physical database connection.
 java.lang.String getURL()
          Returns the database URL used to create the connections in this Connection Pool.
 java.lang.String getXAPassword()
          Returns the Open String password as set with setXAPassword()
 boolean isConnLeakProfilingEnabled()
          This property enables JDBC Connection leak profiling.
 boolean isShrinkingEnabled()
           
 boolean isSqlStmtProfilingEnabled()
          SQL roundtrip profiling stores SQL statement text, execution time and other metrics.
 void setACLName(java.lang.String name)
          Sets the ACL used to control access to this Connection Pool.
 void setCapacityIncrement(int capacity)
          Sets the increment by which the pool capacity is expanded.
 void setConnLeakProfilingEnabled(boolean enable)
           
 void setDriverName(java.lang.String driverClassName)
          Sets the full package name of the JDBC 2-tier driver class used to create the physical connections between the WebLogic Server and the DBMS for this Connection Pool.
 void setInitialCapacity(int capacity)
          Sets number of physical database connections to create when creating the pool.
 void setLoginDelaySeconds(int secs)
          Set number of seconds to delay before creating each physical database connection.
 void setMaxCapacity(int capacity)
          Sets maximum number of physical database connections that this Connection Pool can contain.
 void setPassword(java.lang.String password)
           
 void setPreparedStatementCacheSize(int cacheSize)
          Sets size of the prepared statement cache.
 void setProperties(java.util.Properties props)
          Sets the list of properties passed to the the 2-tier JDBC Driver to use when creating physical database connections.
 void setRefreshMinutes(int minutes)
          Set the connection refresh interval.
 void setShrinkingEnabled(boolean enable)
          Indicates whether or not the pool can shrink back to its InitialCapacity when connections are detected to not be in use.
 void setShrinkPeriodMinutes(int minutes)
          Set the number of minutes to wait before shrinking a connection pool that has incrementally increased to meet demand.
 void setSqlStmtProfilingEnabled(boolean enable)
          This property enables running of JDBC SQL roundtrip profiling.
 void setSupportsLocalTransaction(boolean support)
          This property applies to XA connection pools only, and is ignored for non-XA driver.
 void setTestConnectionsOnRelease(boolean enable)
           
 void setTestConnectionsOnReserve(boolean enable)
           
 void setTestTableName(java.lang.String table)
          Sets the name of the table that will be used when testing a physical database connection.
 void setURL(java.lang.String url)
          Sets the database URL used to create the connections in this Connection Pool.
 void setXAPassword(java.lang.String password)
          XAPassword attribute If set, this value overrides the password in the open string.
 
Methods inherited from interface weblogic.management.configuration.DeploymentMBean
addTarget, getDeploymentOrder, getTargets, removeTarget, setDeploymentOrder, setTargets
 
Methods inherited from interface weblogic.management.configuration.ConfigurationMBean
getNotes, setNotes, setPersistenceEnabled
 
Methods inherited from interface weblogic.management.WebLogicMBean
getMBeanInfo, getName, getObjectName, getParent, getType, isCachingDisabled, isRegistered, setName, setParent
 
Methods inherited from interface javax.management.DynamicMBean
getAttribute, getAttributes, invoke, setAttribute, setAttributes
 
Methods inherited from interface javax.management.MBeanRegistration
postDeregister, postRegister, preDeregister, preRegister
 
Methods inherited from interface javax.management.NotificationBroadcaster
addNotificationListener, getNotificationInfo, removeNotificationListener
 

Method Detail

isConnLeakProfilingEnabled

public boolean isConnLeakProfilingEnabled()
This property enables JDBC Connection leak profiling.

A Connection leak occurs when a connection from the pool is not closed explicitly by calling close() on that connection.

When connection leak profiling is active, the pool will store the stack trace at the time the Connection object is allocated from the pool and given to the client. When a connection leak is detected (when the Connection object is garbage collected), this stack trace is reported.

This feature uses extra resources and will likely slowdown Connection Pool operations, so it is not recommended for production use.

A dynamic MBean attribute
Default Value: false

setConnLeakProfilingEnabled

public void setConnLeakProfilingEnabled(boolean enable)
                                 throws javax.management.InvalidAttributeValueException


isSqlStmtProfilingEnabled

public boolean isSqlStmtProfilingEnabled()
SQL roundtrip profiling stores SQL statement text, execution time and other metrics.

A dynamic MBean attribute
Default Value: false
Returns:
true if JDBC SQL roundtrip profiling enabled

setSqlStmtProfilingEnabled

public void setSqlStmtProfilingEnabled(boolean enable)
                                throws javax.management.InvalidAttributeValueException
This property enables running of JDBC SQL roundtrip profiling. When enabled, SQL statement text, execution time and other metrics are stored externally for further analysis.

This is a resource-consuming feature, so it's recommended that it's turned off on a production server.

A dynamic MBean attribute

getACLName

public java.lang.String getACLName()
Returns the ACL used to control access to this Connection Pool.


setACLName

public void setACLName(java.lang.String name)
                throws javax.management.InvalidAttributeValueException
Sets the ACL used to control access to this Connection Pool. Permissions available to this ACL are reserve and admin. reserve permission allows users to get logical connections from this Connection Pool. admin allows all other operations on this Connection Pool, including: reset, shrink, shutdown, disable, and enable. Lack of an ACL allows any user open access (provided that user passes other WLS security controls).


getURL

public java.lang.String getURL()
Returns the database URL used to create the connections in this Connection Pool.

Old Property: weblogic.jdbc.connectionPool.url

setURL

public void setURL(java.lang.String url)
            throws javax.management.InvalidAttributeValueException
Sets the database URL used to create the connections in this Connection Pool. The URL is passed to the Driver to create the physical database connections.


getDriverName

public java.lang.String getDriverName()
Returns the full package name of the JDBC 2-tier driver class used to create the physical connections between the WebLogic Server and the DBMS for this Connection Pool.

Old Property: weblogic.jdbc.connectionPool.driver

setDriverName

public void setDriverName(java.lang.String driverClassName)
                   throws javax.management.InvalidAttributeValueException
Sets the full package name of the JDBC 2-tier driver class used to create the physical connections between the WebLogic Server and the DBMS for this Connection Pool. It must be the name of a class that implements the java.sql.Driver interface. Check the documentation for the JDBC driver to find the full pathname.


getProperties

public java.util.Properties getProperties()
Returns the list of properties passed to the the 2-tier JDBC Driver to use when creating physical database connections.

Old Property: weblogic.jdbc.connectionPool.props

setProperties

public void setProperties(java.util.Properties props)
                   throws javax.management.InvalidAttributeValueException
Sets the list of properties passed to the the 2-tier JDBC Driver to use when creating physical database connections. The list consists of attribute=value tags, separated by semi-colons. For example user=scott;server=myDB.


getLoginDelaySeconds

public int getLoginDelaySeconds()
Return number of seconds to delay before creating each physical database connection. This delay takes place both during initial pool creation and during the lifetime of the pool whenever a physical database connection is created.

Default Value: 0
Old Property: weblogic.jdbc.connectionPool.loginDelaySecs

setLoginDelaySeconds

public void setLoginDelaySeconds(int secs)
                          throws javax.management.InvalidAttributeValueException
Set number of seconds to delay before creating each physical database connection. Some database servers cannot handle multiple requests for connections in rapid succession. This property allows you to build in a small delay to let the database server catch up. This delay takes place both during initial pool creation and during the lifetime of the pool whenever a physical database connection is created.

Default Value: 0
Legal Minimum Value: 0
Legal Maximum Value: java.lang.Integer.MAX_VALUE

getInitialCapacity

public int getInitialCapacity()
Returns number of physical database connections to create when creating the pool.

Default Value: 1
Old Property: weblogic.jdbc.connectionPool.initialCapacity

setInitialCapacity

public void setInitialCapacity(int capacity)
                        throws javax.management.InvalidAttributeValueException
Sets number of physical database connections to create when creating the pool. If unable to create this number of connections, creation of this Connection Pool will fail. This is also the minimum number of physical connections the pool will keep available.

Default Value: 1
Legal Minimum Value: 0
Legal Maximum Value: java.lang.Integer.MAX_VALUE

getMaxCapacity

public int getMaxCapacity()
Returns the maximum number of physical database connections that this Connection Pool can contain.

Default Value: 1
Old Property: weblogic.jdbc.connectionPool.maxCapacity

setMaxCapacity

public void setMaxCapacity(int capacity)
                    throws javax.management.InvalidAttributeValueException
Sets maximum number of physical database connections that this Connection Pool can contain. Different JDBC Drivers and database servers will likely limit the number of possible physical connections.

Default Value: 1
Legal Minimum Value: 1
Legal Maximum Value: java.lang.Integer.MAX_VALUE

getCapacityIncrement

public int getCapacityIncrement()
Returns the increment by which the pool capacity is expanded.

Default Value: 1
Old Property: weblogic.jdbc.connectionPool.capacityIncrement

setCapacityIncrement

public void setCapacityIncrement(int capacity)
                          throws javax.management.InvalidAttributeValueException
Sets the increment by which the pool capacity is expanded. When there are no more available physical connections to service requests, the pool will create this number of additional physical database connections and add them to the pool. The pool will ensure that it does not exceed the maximum number of physical connections as set by MaxCapacity.

Default Value: 1
Legal Minimum Value: 1
Legal Maximum Value: java.lang.Integer.MAX_VALUE

isShrinkingEnabled

public boolean isShrinkingEnabled()

Default Value: true
Old Property: weblogic.jdbc.connectionPool.allowShrinking
Returns:
true to enable pool shrinking.

setShrinkingEnabled

public void setShrinkingEnabled(boolean enable)
                         throws javax.management.InvalidAttributeValueException
Indicates whether or not the pool can shrink back to its InitialCapacity when connections are detected to not be in use.


getShrinkPeriodMinutes

public int getShrinkPeriodMinutes()
Get the number of minutes to wait before shrinking a connection pool that has incrementally increased to meet demand.

Default Value: 15
Old Property: weblogic.jdbc.connectionPool.shrinkPeriodMins

setShrinkPeriodMinutes

public void setShrinkPeriodMinutes(int minutes)
                            throws javax.management.InvalidAttributeValueException
Set the number of minutes to wait before shrinking a connection pool that has incrementally increased to meet demand. ShrinkingEnabled must be true for shrinking to take place.

Default Value: 15
Legal Minimum Value: 1
Legal Maximum Value: java.lang.Integer.MAX_VALUE

getRefreshMinutes

public int getRefreshMinutes()
Get the connection refresh interval

Default Value: 0
Old Property: weblogic.jdbc.connectionPool.refreshTestMinutes

setRefreshMinutes

public void setRefreshMinutes(int minutes)
                       throws javax.management.InvalidAttributeValueException
Set the connection refresh interval. Every RefreshMinutes unused connections will be tested using TestTableName. Connections that do not pass the test will be closed and reopened in an attempt to reestablish a valid physical database connection. If TestTableName is not set then the test will not be performed.

Default Value: 0
Legal Minimum Value: 0
Legal Maximum Value: 35791394

getTestTableName

public java.lang.String getTestTableName()
Gets the name of the table that will be used when testing a physical database connection.

Old Property: weblogic.jdbc.connectionPool.testTable

setTestTableName

public void setTestTableName(java.lang.String table)
                      throws javax.management.InvalidAttributeValueException
Sets the name of the table that will be used when testing a physical database connection. The default SQL used to test a connection is "select count(*) from TestTableName". The TestTableName must exist and be accessible to the database user for the connection. Most database servers optimize this SQL to avoid a table scan, but it is still a good idea to set TestTableName to the name of a table that is known to have few rows, or even no rows. If TestTableName begins with "SQL ", then the rest of the string, after that leading token, will be taken as a literal sql statement that will be used to test a connection.


getTestConnectionsOnReserve

public boolean getTestConnectionsOnReserve()
When set to true, the WebLogic Server tests a connection before giving it to the client. The test adds a small delay in serving the client's request for a connection from the pool, but ensures that the client receives a working connection (assuming that the DBMS is available and accessible).

Default Value: false
Old Property: weblogic.jdbc.connectionPool.testConnsOnReserve

setTestConnectionsOnReserve

public void setTestConnectionsOnReserve(boolean enable)
                                 throws javax.management.InvalidAttributeValueException


getTestConnectionsOnRelease

public boolean getTestConnectionsOnRelease()
When set to true, the WebLogic Server tests a connection before returning it to the connection pool. If all connections in the pool are already in use and a client is waiting for a connection, the client's wait will be slightly longer while the connection is tested.

Default Value: false
Old Property: weblogic.jdbc.connectionPool.testConnsOnRelease

setTestConnectionsOnRelease

public void setTestConnectionsOnRelease(boolean enable)
                                 throws javax.management.InvalidAttributeValueException


getPassword

public java.lang.String getPassword()
Password attribute If set, this value overrides any password defined in the Properties passed to the tier-2 JDBC Driver when creating physical database connections. The value is stored in an encrypted form in the config.xml and can be used to avoid storing cleartext passwords in that file.


setPassword

public void setPassword(java.lang.String password)
                 throws javax.management.InvalidAttributeValueException


getXAPassword

public java.lang.String getXAPassword()
Returns the Open String password as set with setXAPassword()


setXAPassword

public void setXAPassword(java.lang.String password)
                   throws javax.management.InvalidAttributeValueException
XAPassword attribute If set, this value overrides the password in the open string. This password is used to create XA physical database connections. The value is stored in an encrypted form in the config.xml and can be used to avoid storing cleartext passwords in that file.


getSupportsLocalTransaction

public boolean getSupportsLocalTransaction()

Default Value: false
Returns:
true if XA driver supports SQL with no global transaction. This property applies to XA connection pools only, and is ignored for non-XA driver.

setSupportsLocalTransaction

public void setSupportsLocalTransaction(boolean support)
                                 throws javax.management.InvalidAttributeValueException
This property applies to XA connection pools only, and is ignored for non-XA driver. Whether the XA driver supports SQL with no global transaction.


setPreparedStatementCacheSize

public void setPreparedStatementCacheSize(int cacheSize)
Sets size of the prepared statement cache. The size of the cache is a number of prepared statements created from particular connection and stored in the cache for further use. Setting the size of the prepared statement cache to 0 turns it off.

Legal Value: (value >= weblogic.management.configuration.JDBCLegalHelper.MIN_CACHE_STATEMENTS_SIZE) && (value <= weblogic.management.configuration.JDBCLegalHelper.MAX_CACHE_STATEMENTS_SIZE)
See Also:
getPreparedStatementCacheSize()

getPreparedStatementCacheSize

public int getPreparedStatementCacheSize()
Returns size of the prepared statement cache. The size of the cache is a number of prepared statements created from particular connection and stored in the cache for further use.

Default Value: weblogic.management.configuration.JDBCLegalHelper.DEFAULT_CACHE_STATEMENTS_SIZE
See Also:
setPreparedStatementCacheSize(int)

Documentation is available at
http://download.oracle.com/docs/cd/E13222_01/wls/docs61

WebLogic classes and methods that do not appear in this reference are not public and are not supported.