Class RolapConnectionPool


  • class RolapConnectionPool
    extends Object
    Singleton class that holds a connection pool. Call RolapConnectionPool.instance().getPoolingDataSource(connectionFactory) to get a DataSource in return that is a pooled data source.
    Since:
    7 July, 2003
    Author:
    jhyde, Robin Bagot
    • Method Detail

      • getPoolingDataSource

        public DataSource getPoolingDataSource​(Object key,
                                               org.apache.commons.dbcp.ConnectionFactory connectionFactory)
        Sets up a pooling data source for connection pooling. This can be used if the application server does not have a pooling dataSource already configured.

        This takes a normal jdbc connection string, and requires a jdbc driver to be loaded, and then uses a DriverManagerConnectionFactory to create connections to the database.

        An alternative method of configuring a pooling driver is to use an external configuration file. See the the Apache jakarta-commons commons-pool documentation.

        Parameters:
        key - Identifies which connection factory to use. A typical key is a JDBC connect string, since each JDBC connect string requires a different connection factory.
        connectionFactory - Creates connections from an underlying JDBC connect string or DataSource
        Returns:
        a pooling DataSource object
      • clearPool

        void clearPool()
        Clears the connection pool for testing purposes
      • getDriverManagerPoolingDataSource

        public DataSource getDriverManagerPoolingDataSource​(String jdbcConnectString,
                                                            Properties jdbcProperties)