ca.sqlpower.wabit.rs.olap
Class OlapConnectionPool

java.lang.Object
  extended by ca.sqlpower.wabit.rs.olap.OlapConnectionPool

public class OlapConnectionPool
extends java.lang.Object

This class will create one connection to an Olap4jDataSource. This class is useful to prevent opening lots of connections causing extra caching.


Constructor Summary
OlapConnectionPool(ca.sqlpower.sql.Olap4jDataSource ds, ca.sqlpower.sqlobject.SQLDatabaseMapping dbMapping)
          Creates and pools a new connection based on the information in dataSource.
 
Method Summary
 void disconnect()
          This method will close all of the open connections in the pool.
 org.olap4j.OlapConnection getConnection()
           
 ca.sqlpower.sql.Olap4jDataSource getDataSource()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OlapConnectionPool

public OlapConnectionPool(ca.sqlpower.sql.Olap4jDataSource ds,
                          ca.sqlpower.sqlobject.SQLDatabaseMapping dbMapping)
                   throws java.sql.SQLException,
                          java.lang.ClassNotFoundException,
                          javax.naming.NamingException
Creates and pools a new connection based on the information in dataSource.

Parameters:
dbMapping - If the dataSource is an in-process data source this should contain the mapping from the JDBCDataSource to the SQLDatabase that is pooling the connections. If the dataSource is an XML/A data source this value can be null.
Throws:
javax.naming.NamingException
java.lang.ClassNotFoundException
java.sql.SQLException
Method Detail

getConnection

public org.olap4j.OlapConnection getConnection()
                                        throws java.sql.SQLException,
                                               java.lang.ClassNotFoundException,
                                               javax.naming.NamingException
Throws:
java.sql.SQLException
java.lang.ClassNotFoundException
javax.naming.NamingException

disconnect

public void disconnect()
                throws java.sql.SQLException
This method will close all of the open connections in the pool.

Throws:
java.sql.SQLException

getDataSource

public ca.sqlpower.sql.Olap4jDataSource getDataSource()


Copyright © 2009. All Rights Reserved.