下载此文档

一个连接池的例子(来自JIVE)(3)(2).txt


文档分类:IT计算机 | 页数:约8页 举报非法文档有奖
1/ 8
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/ 8 下载此文档
文档列表 文档介绍
作者: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

一个连接池的例子(来自JIVE)(3)(2) 来自淘豆网www.taodocs.com转载请标明出处.

非法内容举报中心
文档信息
  • 页数 8
  • 收藏数 0 收藏
  • 顶次数 0
  • 上传人 管理资源吧
  • 文件大小 0 KB
  • 时间2011-09-11
最近更新