com.facetmap.sql
Class ConnectionPoolManager
java.lang.Object
com.facetmap.sql.ConnectionPoolManager
- All Implemented Interfaces:
- ConnectionManager
public class ConnectionPoolManager
- extends java.lang.Object
- implements ConnectionManager
Pools a number of connections specified by properties, and reuses
connections from the pool. Required properties are:
com.facetmap.sql.jdbcDriver
- fully-qualified name of the driver class
com.facetmap.sql.jdbcUrl
- JDBC-protocol URL of the database to use, for example
jdbc:mysql://localhost:3306/databaseName?user=facetmap
|
Field Summary |
protected java.lang.String |
poolName
|
protected java.lang.String |
poolUrl
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
poolName
protected java.lang.String poolName
poolUrl
protected java.lang.String poolUrl
ConnectionPoolManager
public ConnectionPoolManager(java.util.Properties props)
throws DataException
- Throws:
DataException
ConnectionPoolManager
public ConnectionPoolManager(java.lang.String poolName,
java.util.Properties props)
throws DataException
- Throws:
DataException
getConnection
public java.sql.Connection getConnection()
throws java.sql.SQLException
- Specified by:
getConnection in interface ConnectionManager
- Throws:
java.sql.SQLException
install
public void install(java.util.Properties props)
throws DataException
- Parameters:
props - com.facetmap.sql properties representing the connections to be pooled
- Throws:
DataException
registerDriver
public java.lang.String registerDriver(java.lang.String poolName,
java.lang.String underlyingJdbcUrl)
- Parameters:
underlyingJdbcUrl - The url of the connections to be pooled
- Returns:
- the jdbc url of the newly registered Connection pool
getPoolName
public java.lang.String getPoolName()
getConnectionUrl
public java.lang.String getConnectionUrl()