| 网站首页 | JAVA文章 | AppServers | Web开发 | 应用开发 | 资源下载 | 论坛
    想学好编程,学好外语很重要  [enadd  2006年12月25日]        
设为首页 加入收藏 联系站长
您现在的位置: 编程笔记网 >> JAVA文章 >> 数据库 >> 文章正文
一个连接池的例子(来自JIVE)(2)        【字体:
一个连接池的例子(来自JIVE)(2)
作者:-    文章来源:-    点击数:    更新时间:2006-4-29

//文件:DbConnectionDefaultPool.java的第二部分


        /**
         * Housekeeping thread.  Runs in the background with low CPU overhead.
         * Connections are checked for warnings and closure and are periodically
         * restarted.
         * This thread is a catchall for corrupted
         * connections and prevents the buildup of open cursors. (Open cursors
         * result when the application fails to close a Statement).
         * This method acts as fault tolerance for bad connection/statement programming.
         */
        public void run() {
            boolean forever = true;
            Statement stmt=null;
            String currCatalog=null;

            while(forever) {

                // Make sure the log file is the one this instance opened
                // If not, clean it up!
                try {
                    BufferedReader in = new BufferedReader(new
                        FileReader(logFileString + "pid"));
                    String curr_pid = in.readLine();
                    if(curr_pid.equals(pid)) {
                        //log.println("They match = " + curr_pid);
                    }
                    else

[1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] 下一页  

文章录入:enadd    责任编辑:enadd 
  • 上一篇文章:

  • 下一篇文章:
  • 发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
    最新热点 最新推荐 相关文章
  • 一个连接池的例子(来自JIVE…

  • 一个连接池的例子(来自JIVE…

  • 一个连接池的例子(来自JIVE…

  • 优化JDBC编程-多提提意见

  • 用JDBC连接Oracle数据库(问…

  • JDBC连接oracle数据库的十大…

  • 通过jdbc-odbc往Access数据…

  • clob字段的处理(oracle)

  • 处理blob的完整例子

  • 更正访问远程数据库的方法!…

  •   网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)
    | 设为首页 | 加入收藏 | 联系站长 | 友情链接 | 版权申明 | 管理登录 |