|
jPOS 1.6.7 API Documentation | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jpos.tpl.ConnectionPool
public class ConnectionPool
A class for preallocating, recycling, and managing JDBC connections.
Taken from Core Servlets and JavaServer Pages from Prentice Hall and Sun Microsystems Press, http://www.coreservlets.com/. © 2000 Marty Hall; may be freely used or adapted.
| Constructor Summary | |
|---|---|
ConnectionPool()
no args constructor |
|
ConnectionPool(java.lang.String driver,
java.lang.String url,
java.lang.String username,
java.lang.String password,
int initialConnections,
int maxConnections,
boolean waitIfBusy)
To invoke the Connection Pool object directly without jPOS. |
|
| Method Summary | |
|---|---|
void |
closeAllConnections()
Close all the connections. |
void |
free(java.sql.Connection connection)
|
java.sql.Connection |
getConnection()
|
static ConnectionPool |
getConnectionPool(java.lang.String name)
|
Logger |
getLogger()
|
java.lang.String |
getRealm()
|
int |
getTotalConnections()
|
void |
run()
|
void |
setConfiguration(Configuration cfg)
|
void |
setLogger(Logger logger,
java.lang.String realm)
|
java.lang.String |
toString()
|
int |
totalConnections()
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ConnectionPool()
public ConnectionPool(java.lang.String driver,
java.lang.String url,
java.lang.String username,
java.lang.String password,
int initialConnections,
int maxConnections,
boolean waitIfBusy)
throws java.sql.SQLException
java.sql.SQLException| Method Detail |
|---|
public void setConfiguration(Configuration cfg)
throws ConfigurationException
setConfiguration in interface Configurablecfg - Configuration object
ConfigurationException
public java.sql.Connection getConnection()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void run()
run in interface java.lang.Runnablepublic void free(java.sql.Connection connection)
public int totalConnections()
public int getTotalConnections()
public void closeAllConnections()
public java.lang.String toString()
toString in class java.lang.Object
public void setLogger(Logger logger,
java.lang.String realm)
setLogger in interface LogSourcepublic java.lang.String getRealm()
getRealm in interface LogSourcepublic Logger getLogger()
getLogger in interface LogSource
public static ConnectionPool getConnectionPool(java.lang.String name)
throws NameRegistrar.NotFoundException
NameRegistrar.NotFoundException;
NameRegistrar.NotFoundExceptionNameRegistrar
|
jPOS.org | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||