net.sourceforge.idrs.jdbc
Class JDBCPool
java.lang.Object
|
+--net.sourceforge.idrs.utils.pool.ObjectPool
|
+--net.sourceforge.idrs.jdbc.JDBCPool
- All Implemented Interfaces:
- java.io.Serializable
- public class JDBCPool
- extends ObjectPool
JDBCPool is an ObjectPool of JDBC connection objects.
- See Also:
- Serialized Form
Fields inherited from class net.sourceforge.idrs.utils.pool.ObjectPool |
count, daysOpen, debug, DEFAULT_DAYS_OPEN, DEFAULT_EXPIRATION, DEFAULT_MIN_POOLSIZE, DEFAULT_PATH, DEFAULT_SLEEPTIME, DEFAULT_TIMEOUT, DEFAULT_TRYS, limit, logPath, MAX_POOLSIZE, maxTrys, minn, out, pool, sleepTime |
Constructor Summary |
JDBCPool(java.lang.String poolname,
java.lang.String drivername,
java.lang.String url,
java.lang.String username,
java.lang.String password,
int min,
int limit,
long daysOpen,
long sleep,
java.lang.String path,
int trys)
Create a JDBCPool with full control of all parameters. |
Methods inherited from class java.lang.Object |
, clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
info
protected JDBCInfo info
JDBCPool
public JDBCPool(java.lang.String poolname,
java.lang.String drivername,
java.lang.String url,
java.lang.String username,
java.lang.String password,
int min,
int limit,
long daysOpen,
long sleep,
java.lang.String path,
int trys)
throws java.lang.Exception
- Create a JDBCPool with full control of all parameters.
- Parameters:
drivername
- the name of the sql driverurl
- the url for the db connectionusername
- the user of the db connectionspassword
- the paswer for the db usertimeout
- the timout for a given connectionsleep
- the amount of time between sk4m cycles.limit
- is the maximum number of open connections allowed.
logHeader
protected void logHeader()
throws java.lang.Exception
- Overrides:
logHeader
in class ObjectPool
create
protected PooledObject create()
throws java.sql.SQLException
- Creates a new JDBC connection
- Overrides:
create
in class ObjectPool
validate
protected boolean validate(PooledObject o)
- Checks to see if the current connection is valid.
- Overrides:
validate
in class ObjectPool
expire
protected void expire(PooledObject o)
- Closes a database connection.
- Overrides:
expire
in class ObjectPool
getConnection
public java.sql.Connection getConnection()
throws java.sql.SQLException
- Retrieves a connection. Renamed from requestConnection
freeConnection
public void freeConnection(java.sql.Connection conn)
throws java.lang.Exception
- Returns a connection to the pool. Renamed from returnConnection
freeConnection
public void freeConnection(java.lang.String connName)
throws java.lang.Exception
getInfo
public JDBCInfo getInfo()
setInfo
public void setInfo(JDBCInfo i)
hashCode
public int hashCode()
- Overrides:
hashCode
in class java.lang.Object
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in class java.lang.Object
reset
protected void reset(int index)
- Overrides:
reset
in class ObjectPool