|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.aitools.programd.util.sql.ObjectPool
org.aitools.programd.util.sql.DbAccessRefsPoolMgr
public class DbAccessRefsPoolMgr
Manages a pool of references to a database.
| Field Summary | |
|---|---|
protected String |
driver
The name of the driver used by this object. |
protected String |
password
The password used by this object. |
protected String |
url
The URL string used by this object. |
protected String |
user
The user name used by this object. |
| Constructor Summary | |
|---|---|
DbAccessRefsPoolMgr(String driverToUse,
String urlToUse,
String userToUse,
String passwordToUse)
Constructs a DbAccessRefsPoolMgr object given a driver,
url, user name and password. |
|
| Method Summary | |
|---|---|
protected Object |
create()
Initializes the object by attempting to get a DbAccess
object based on the parameters set. |
protected void |
expire(Object o)
Expires an object in the pool. |
void |
populate(int connectionCount)
Builds a pool of the specified number of connections. |
void |
returnDbaRef(DbAccess dba)
Checks back in and locks a DbAccess reference to the
database. |
DbAccess |
takeDbaRef()
Checks out and unlocks a DbAccess reference to the
database. |
protected boolean |
validate(Object o)
Validates an object in the pool. |
| Methods inherited from class org.aitools.programd.util.sql.ObjectPool |
|---|
checkIn, checkOut, cleanUp |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected String driver
protected String url
protected String user
protected String password
| Constructor Detail |
|---|
public DbAccessRefsPoolMgr(String driverToUse,
String urlToUse,
String userToUse,
String passwordToUse)
DbAccessRefsPoolMgr object given a driver,
url, user name and password.
driverToUse - name of the class representing the Driver to be used
by the Driver managerurlToUse - location of a data source name (dsn)userToUse - user namepasswordToUse - password for user| Method Detail |
|---|
protected Object create()
DbAccess
object based on the parameters set.
create in class ObjectPoolpublic void populate(int connectionCount)
connectionCount - the number of connections to createpublic void returnDbaRef(DbAccess dba)
DbAccess reference to the
database.
dba - the reference to returnpublic DbAccess takeDbaRef()
DbAccess reference to the
database.
protected boolean validate(Object o)
ObjectPool
validate in class ObjectPoolo - the object to validate
protected void expire(Object o)
ObjectPool
expire in class ObjectPoolo - the object to expire
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||