mondrian.rolap
Class RolapConnectionPool
java.lang.Object
mondrian.rolap.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.
-
-
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
instance
public static RolapConnectionPool instance()
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