%META:TOPICPARENT{name="JDBC3DriverClasses"}% 11.11.3. Class OPLConnectionPoolDataSource OPLConnectionPoolDataSource Classes OPLConnectionPoolDataSource A ConnectionPoolDataSource object is a factory for PooledConnection objects. An object that implements this interface will typically be registered with a JNDI service. 11.11.3.1. Synopsis public class OPLConnectionPoolDataSource extends OPLDataSource implements ConnectionPoolDataSource,Serializable,Referenceable,ConnectionEventListener { // Public Constructors public OPLConnectionPoolDataSource(); // Public Methods public void finalize() throws java.lang.Throwable; public OPLPoolStatistic get_statistics(); public OPLPoolStatistic[] getAll_statistics(); public void close() throws java.sql.SQLException; public void connectionClosed(javax.sql.ConnectionEvent event); public void connectionErrorOccurred(javax.sql.ConnectionEvent event); public Reference getReference() throws javax.naming.NamingException; public void fill() throws java.sql.SQLException; public PooledConnection getPooledConnection() throws java.sql.SQLException; public PooledConnection getPooledConnection(java.lang.String _user, java.lang.String _password) throws java.sql.SQLException; public int getMinPoolSize(); public void setMinPoolSize(int parm) throws java.sql.SQLException; public int getMaxPoolSize(); public void setMaxPoolSize(int parm) throws java.sql.SQLException; public int getInitialPoolSize(); public void setInitialPoolSize(int parm) throws java.sql.SQLException; public int getMaxIdleTime(); public void setMaxIdleTime(int parm) throws java.sql.SQLException; public int getPropertyCycle(); public void setPropertyCycle(int parm); public int getMaxStatements(); public void setMaxStatements(int parm) throws java.sql.SQLException; } Inheritance Path java.lang.Object | openlink.javax.OPLDataSource | openlink.javax.OPLConnectionPoolDataSource 11.11.3.2. Members 11.11.3.2.1. Method close() close Methods close Synopsis: public void close() throws java.sql.SQLException; Exceptions java.sql.SQLException if a database-access error occurs Physically close all the pooled connections in the cache and free all the resources 11.11.3.2.2. Method connectionClosed(ConnectionEvent) connectionClosed Methods connectionClosed Synopsis: public void connectionClosed(javax.sql.ConnectionEvent event); Parameters event - an event object describing the source of the event Invoked when the application calls close() on its representation of the connection. 11.11.3.2.3. Method connectionErrorOccurred(ConnectionEvent) connectionErrorOccurred Methods connectionErrorOccurred Synopsis: public void connectionErrorOccurred(javax.sql.ConnectionEvent event); Parameters event - an event object describing the source of the event Invoked when a fatal connection error occurs, just before an SQLException is thrown to the application. 11.11.3.2.4. Method fill() fill Methods fill Synopsis: public void fill() throws java.sql.SQLException; Exceptions java.sql.SQLException if a error occurs Fills the cache with PooledConnections for later use. Ignored if the MinPoolSize is 0. It is usually called when the OPLConnectionPoolDataSource is created via JNDI calls. 11.11.3.2.5. Method get_statistics() get_statistics Methods get_statistics Synopsis: public OPLPoolStatistic get_statistics(); Return the cache statistics for the OPLConnectionPoolDataSource 11.11.3.2.6. Method getAll_statistics() getAll_statistics Methods getAll_statistics Synopsis: public OPLPoolStatistic[] getAll_statistics(); Return an array of the cache statistics for the all created OPLConnectionPoolDataSources 11.11.3.2.7. Method getInitialPoolSize() getInitialPoolSize Methods getInitialPoolSize Synopsis: public int getInitialPoolSize(); Get the number of physical connections the pool will contain when it is created 11.11.3.2.8. Method getMaxIdleTime() getMaxIdleTime Methods getMaxIdleTime Synopsis: public int getMaxIdleTime(); Get the number of seconds that a physical connection will remain unused in the pool before the connection is closed. Zero ( 0 ) indicates no limit. 11.11.3.2.9. Method getMaxPoolSize() getMaxPoolSize Methods getMaxPoolSize Synopsis: public int getMaxPoolSize(); Get the maximum number of physical connections the pool will be able contain. Zero ( 0 ) indicates no maximum size. 11.11.3.2.10. Method getMaxStatements() getMaxStatements Methods getMaxStatements Synopsis: public int getMaxStatements(); Get the total number of statements that the pool will keep open. Zero ( 0 ) indicates that caching of statements is disabled. 11.11.3.2.11. Method getMinPoolSize() getMinPoolSize Methods getMinPoolSize Synopsis: public int getMinPoolSize(); Get the minimum number of physical connections the pool will keep available at all times. Zero ( 0 ) indicates that connections will be created as needed. 11.11.3.2.12. Method getPooledConnection() getPooledConnection Methods getPooledConnection Synopsis: public PooledConnection getPooledConnection() throws java.sql.SQLException; Exceptions java.sql.SQLException if a database-access error occurs Attempt to establish a database connection. 11.11.3.2.13. Method getPooledConnection(String, String) getPooledConnection Methods getPooledConnection Synopsis: public PooledConnection getPooledConnection(java.lang.String _user, java.lang.String _password) throws java.sql.SQLException; Parameters user - the database user on whose behalf the Connection is being made password - the user's password return - a PooledConnection to the database Exceptions java.sql.SQLException if a database-access error occurs Attempt to establish a database connection. 11.11.3.2.14. Method getPropertyCycle() getPropertyCycle Methods getPropertyCycle Synopsis: public int getPropertyCycle(); Get the interval, in seconds, that the pool will wait before enforcing the current policy defined by the values of the above connection pool properties 11.11.3.2.15. Method setInitialPoolSize(int) setInitialPoolSize Methods setInitialPoolSize Synopsis: public void setInitialPoolSize(int parm) throws java.sql.SQLException; Parameters parm - a number of physical connections Exceptions java.sql.SQLException if an error occurs Set the number of physical connections the pool should contain when it is created 11.11.3.2.16. Method setMaxIdleTime(int) setMaxIdleTime Methods setMaxIdleTime Synopsis: public void setMaxIdleTime(int parm) throws java.sql.SQLException; Parameters parm - a number of seconds Exceptions java.sql.SQLException if an error occurs Set the number of seconds that a physical connection should remain unused in the pool before the connection is closed. Zero ( 0 ) indicates no limit. 11.11.3.2.17. Method setMaxPoolSize(int) setMaxPoolSize Methods setMaxPoolSize Synopsis: public void setMaxPoolSize(int parm) throws java.sql.SQLException; Parameters parm - a maximum number of physical connections Exceptions java.sql.SQLException if an error occurs Set the maximum number of physical conections that the pool should contain. Zero ( 0 ) indicates no maximum size. The default value is 0 . 11.11.3.2.18. Method setMaxStatements(int) setMaxStatements Methods setMaxStatements Synopsis: public void setMaxStatements(int parm) throws java.sql.SQLException; Parameters parm - a total number of statements Exceptions java.sql.SQLException if an error occurs Set the total number of statements that the pool should keep open. Zero ( 0 ) indicates that caching of statements is disabled. 11.11.3.2.19. Method setMinPoolSize(int) setMinPoolSize Methods setMinPoolSize Synopsis: public void setMinPoolSize(int parm) throws java.sql.SQLException; Parameters parm - a minimum number of physical connections Exceptions java.sql.SQLException if an error occurs Set the number of physical connections the pool should keep available at all times. Zero ( 0 ) indicates that connections should be created as needed The default value is 0 . 11.11.3.2.20. Method setPropertyCycle(int) setPropertyCycle Methods setPropertyCycle Synopsis: public void setPropertyCycle(int parm); Parameters parm - an interval (in seconds) Set the interval, in seconds, that the pool should wait before enforcing the current policy defined by the values of the above connection pool properties