|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectsky.engine.connector.database.DBPool
DBPool maintains and recycles open connections to the back-end database. These connections all allocated to forms as needed so that a new connection does not need to be created and destory everytime a form is invoked by the end-user.
$RCSfile: DBPool.java,v $
$Revision: 1.5 $, $Date: 2005/04/24 03:14:04 $
| Field Summary | |
protected DBConnection[] |
_cons
Open connections in this connection pool. |
protected java.lang.String |
_jdrv
JDBC driver name. |
protected java.lang.String |
_jurl
JDBC URL over which this connection pool works. |
protected int |
_maxconn
Maximum limit on number of connections in this pool. |
protected int |
_maxstmt
Maximum limit on number of statements a connection can have. |
protected boolean[] |
_used
flags to keep track of connections that are being currently used. |
static FormattedResourceBundle |
STRINGS
|
| Constructor Summary | |
DBPool(java.lang.String driver,
java.lang.String url,
int maxconn,
int maxstmt)
Constructor. |
|
| Method Summary | |
DBConnection |
getConnection()
Iterate through all the connections in this connection pool to locate a connection that is not being used. |
void |
returnConnection(DBConnection conn)
Call this function after your done with using a connection. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected java.lang.String _jdrv
protected java.lang.String _jurl
protected DBConnection[] _cons
protected boolean[] _used
protected int _maxconn
protected int _maxstmt
public static final FormattedResourceBundle STRINGS
| Constructor Detail |
public DBPool(java.lang.String driver,
java.lang.String url,
int maxconn,
int maxstmt)
driver - JDBC driver name.url - JDBC URL.maxconn - Maximum limit on the number of connections in this connection pool.maxstmt - Maximum limit on the number of statements each connection can have.| Method Detail |
public DBConnection getConnection()
throws ErrorMessage
ErrorMessage - in case there are any problems.public void returnConnection(DBConnection conn)
conn - database connection that is currently being used.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||