|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.raritantechnologies.searchApp.database.ConnectionPool
Implementation of ConnectionManager that can do its own connection pooling.
XML Configuration Template:
<SystemObject type="DatabaseConnectionManager" name="[my name]"
class="com.raritantechnologies.searchApp.database.ConnectionPool"
driver="[JDBC driver class]"
name="[DB name]"
userName="[db user]"
password="[db password]"
URL="[jdbc url]"
initConnections="2"
maxConnections="5"
timeout="3"
instanceType="single" /> <!-- singleton is pretty much a requirement for this -->
| Constructor Summary | |
ConnectionPool()
|
|
ConnectionPool(java.lang.String strName,
java.lang.String strURL,
java.lang.String strUser,
java.lang.String strPassword,
int iMaxConns,
int iInitConns,
int iTimeout)
|
|
ConnectionPool(java.lang.String strName,
java.lang.String strURL,
java.lang.String strUser,
java.lang.String strPassword,
int iMaxConns,
int iInitConns,
int iTimeout,
java.lang.String driverClass)
|
|
| Method Summary | |
void |
closeConnection(java.sql.Connection conn)
|
void |
finalize()
Called by the JVM Garbage Collector: release all connections. |
java.sql.Connection |
getConnection()
returns a java.sql.Connection object wrapped in a ConnectionWrapper. |
void |
initialize(org.w3c.dom.Element elem)
Initializes the object from an XML tag or element. |
void |
release()
releases all connections. |
void |
wrapperClosed(java.sql.Connection conn)
returns a Connection object to the ConnectionPool for reuse. |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ConnectionPool()
public ConnectionPool(java.lang.String strName,
java.lang.String strURL,
java.lang.String strUser,
java.lang.String strPassword,
int iMaxConns,
int iInitConns,
int iTimeout)
public ConnectionPool(java.lang.String strName,
java.lang.String strURL,
java.lang.String strUser,
java.lang.String strPassword,
int iMaxConns,
int iInitConns,
int iTimeout,
java.lang.String driverClass)
| Method Detail |
public void initialize(org.w3c.dom.Element elem)
IConfigurable
initialize in interface IConfigurable
public java.sql.Connection getConnection()
throws java.sql.SQLException
getConnection in interface IDatabaseConnectionManagerjava.sql.SQLExceptionpublic void wrapperClosed(java.sql.Connection conn)
public void release()
public void finalize()
public void closeConnection(java.sql.Connection conn)
throws java.sql.SQLException
java.sql.SQLException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||