文档介绍:作者:sonymusic
email: sonymusic@
日期:2001-5-17 11:34:25
//文件:
/**
* Returns the age of a connection -- the time since it was handed out to
* an application.
*/
public long getAge(Connection conn) { // Returns the age of the connection in millisec.
int thisconn = idOfConnection(conn);
return () - connLockTime[thisconn];
}
private void createConn(int i) throws SQLException {
Date now = new Date();
try {
(dbDriver);
Properties dbProp = new Properties();
//("Creating.....");
("user", dbLogin);
("password", dbPassword);
("characterEncoding","gb2112");
//("useUnicode", "true");
connPool[i] =
(dbServer,dbProp);
//("Created Ok...");
connStatus[i]=0;
connID[i]=connPool[i].toString();
connLockTime[i]=0;
connCreateDate[i] = ();
}
catch (ClassNotFoundException e2) {}
(() + " Opening connection " + (i) +
" " + connPool[i].toString() + ":");
}
/**
* Shuts down the housekeeping thread and closes all connections
* in the pool. Call this method from the destroy() method of the servlet.
*/
/**
* Multi-phase shutdown. having following sequence:
* <OL>
* <LI><code>getConnection()</code> will refuse to return