亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? dbconnectiondefaultpool.java

?? Jvie論壇的程序
?? JAVA
?? 第 1 頁 / 共 3 頁
字號:
/**
 * Copyright (C) 2001 Yasna.com. All rights reserved.
 *
 * ===================================================================
 * The Apache Software License, Version 1.1
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 *
 * 3. The end-user documentation included with the redistribution,
 *    if any, must include the following acknowledgment:
 *       "This product includes software developed by
 *        Yasna.com (http://www.yasna.com)."
 *    Alternately, this acknowledgment may appear in the software itself,
 *    if and wherever such third-party acknowledgments normally appear.
 *
 * 4. The names "Yazd" and "Yasna.com" must not be used to
 *    endorse or promote products derived from this software without
 *    prior written permission. For written permission, please
 *    contact yazd@yasna.com.
 *
 * 5. Products derived from this software may not be called "Yazd",
 *    nor may "Yazd" appear in their name, without prior written
 *    permission of Yasna.com.
 *
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED.  IN NO EVENT SHALL YASNA.COM OR
 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 * ====================================================================
 *
 * This software consists of voluntary contributions made by many
 * individuals on behalf of Yasna.com. For more information
 * on Yasna.com, please see <http://www.yasna.com>.
 */

/**
 * Copyright (C) 2000 CoolServlets.com. All rights reserved.
 *
 * ===================================================================
 * The Apache Software License, Version 1.1
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 *
 * 3. The end-user documentation included with the redistribution,
 *    if any, must include the following acknowledgment:
 *       "This product includes software developed by
 *        CoolServlets.com (http://www.coolservlets.com)."
 *    Alternately, this acknowledgment may appear in the software itself,
 *    if and wherever such third-party acknowledgments normally appear.
 *
 * 4. The names "Jive" and "CoolServlets.com" must not be used to
 *    endorse or promote products derived from this software without
 *    prior written permission. For written permission, please
 *    contact webmaster@coolservlets.com.
 *
 * 5. Products derived from this software may not be called "Jive",
 *    nor may "Jive" appear in their name, without prior written
 *    permission of CoolServlets.com.
 *
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED.  IN NO EVENT SHALL COOLSERVLETS.COM OR
 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 * ====================================================================
 *
 * This software consists of voluntary contributions made by many
 * individuals on behalf of CoolServlets.com. For more information
 * on CoolServlets.com, please see <http://www.coolservlets.com>.
 */

package com.Yasna.forum.database;

import java.sql.*;
import java.util.*;
import java.io.*;
import java.text.*;
import java.util.Date;
import com.Yasna.forum.*;

/**
 * Default Yazd connection provider. It uses the excellent connection pool
 * available from http://www.javaexchange.com. This connection provider is a
 * a good choice unless you can use a container-managed one.
 */
public class DbConnectionDefaultPool extends DbConnectionProvider {

    private static final String NAME = "Default Connection Pool";
    private static final String DESCRIPTION = "The default connection provider "
        + "that uses the connection pool from javaexchange.com. It works with "
        + "almost any database setup, is customizable, and offers good performance. "
        + "Use this connection provider unless you have your own or can use a "
        + "container managed connection pool.";
    private static final String AUTHOR = "Yazd.Yasna.com";
    private static final int MAJOR_VERSION = 1;
    private static final int MINOR_VERSION = 0;
    private static final boolean POOLED = true;

    private ConnectionPool connectionPool = null;
    private Properties props;
    private Properties propDescriptions;

    private Object initLock = new Object();

    public DbConnectionDefaultPool() {
        //this.manager = manager;
        props = new Properties();
        propDescriptions = new Properties();
        //Initialize all property values
        initializeProperties();
        //Load any existing property values
        loadProperties();
    }

    /**
     * Returns a database connection.
     */
    public Connection getConnection() {
        if (connectionPool == null) {
            //block until the init has been done
            synchronized(initLock) {
                //if still null, something has gone wrong
                if (connectionPool == null) {
                    System.err.println("Warning: DbConnectionDefaultPool.getConnection() was " +
                    "called when the internal pool has not been initialized.");
                    return null;
                }
            }
        }
        return new ConnectionWrapper(connectionPool.getConnection(), connectionPool);
    }

    /**
     * Starts the pool.
     */
    protected void start() {
        //acquire lock so that no connections can be returned.
        synchronized (initLock) {
            //Get properties
            String driver = props.getProperty("driver");
            String server = props.getProperty("server");
            String username = props.getProperty("username");
            String password = props.getProperty("password");
            int minConnections = 0, maxConnections = 0;
            double connectionTimeout = 0.0;
            try {
                minConnections = Integer.parseInt(props.getProperty("minConnections"));
                maxConnections = Integer.parseInt(props.getProperty("maxConnections"));
                connectionTimeout = Double.parseDouble(props.getProperty("connectionTimeout"));
            }
            catch (Exception e) {
                System.err.println("Error: could not parse default pool properties. " +
                    "Make sure the values exist and are correct.");
                e.printStackTrace();
                return;
            }
            String logPath = props.getProperty("logPath");

            try {
                connectionPool = new ConnectionPool(driver, server, username, password,
                    minConnections, maxConnections, logPath, connectionTimeout);
            }
            catch (IOException ioe) {
                System.err.println("Error starting DbConnectionDefaultPool: " + ioe);
                ioe.printStackTrace();
            }
        }
    }

    /**
     * Restarts the pool to take into account any property changes.
     */
    protected void restart() {
        //Kill off pool.
        destroy();
        //Reload properties.
        loadProperties();
        //Start a new pool.
        start();
    }

    /**
     * Destroys the connection pool.
     */
    protected void destroy() {
        if (connectionPool != null) {
            try {
                connectionPool.destroy(1);
            }
            catch (Exception e) {
                e.printStackTrace();
            }
        }
        //Release reference to connectionPool
        connectionPool = null;
    }

    /**
     * Returns the value of a property of the connection provider.
     *
     * @param name the name of the property.
     * @returns the value of the property.
     */
    public String getProperty(String name) {
        return (String)props.get(name);
    }

    /**
     * Returns the description of a property of the connection provider.
     *
     * @param name the name of the property.
     * @return the description of the property.
     */
    public String getPropertyDescription(String name) {
        return (String)propDescriptions.get(name);
    }

    /**
     * Returns an enumeration of the property names for the connection provider.
     */
    public Enumeration propertyNames() {
        return props.propertyNames();
    }

    /**
     * Sets a property of the connection provider. Each provider has a set number
     * of properties that are determined by the author. Trying to set a non-
     * existant property will result in an IllegalArgumentException.
     *
     * @param name the name of the property to set.
     * @param value the new value for the property.
     *
     */
    public void setProperty(String name, String value) {
        props.put(name, value);
        saveProperties();
    }

    /**
     * Give default values to all the properties and descriptions.
     */
    private void initializeProperties() {
        props.put("driver","");
        props.put("server","");
        props.put("username","");
        props.put("password","");
        props.put("minConnections","");
        props.put("maxConnections","");
        props.put("logPath","");
        props.put("connectionTimeout","");

        propDescriptions.put("driver","JDBC driver. e.g. 'oracle.jdbc.driver.OracleDriver'");
        propDescriptions.put("server","JDBC connect string. e.g. 'jdbc:oracle:thin:@203.92.21.109:1526:orcl'");
        propDescriptions.put("username","Database username. e.g. 'Scott'");
        propDescriptions.put("password","Database password. e.g. 'Tiger'");
        propDescriptions.put("minConnections","Minimum # of connections to start with in pool. Three is the recommended minimum");
        propDescriptions.put("maxConnections","Maximum # of connections in dynamic pool. Fifteen should give good performance for an average load.");
        propDescriptions.put("logPath","Absolute path name for log file. e.g. 'c:\\logs\\yazdDbLog.log'");
        propDescriptions.put("connectionTimeout","Time in days between connection resets. e.g. '.5'");
    }

    /**
     * Load whatever properties that already exist.
     */
    private void loadProperties() {
        String driver = PropertyManager.getProperty("DbConnectionDefaultPool.driver");
        String server = PropertyManager.getProperty("DbConnectionDefaultPool.server");
        String username = PropertyManager.getProperty("DbConnectionDefaultPool.username");
        String password = PropertyManager.getProperty("DbConnectionDefaultPool.password");
        String minConnections = PropertyManager.getProperty("DbConnectionDefaultPool.minConnections");
        String maxConnections = PropertyManager.getProperty("DbConnectionDefaultPool.maxConnections");
        String logPath = PropertyManager.getProperty("DbConnectionDefaultPool.logPath");
        String connectionTimeout = PropertyManager.getProperty("DbConnectionDefaultPool.connectionTimeout");

        if (driver != null) {  props.setProperty("driver", driver);  }
        if (server != null) {  props.setProperty("server", server);  }
        if (username != null) {  props.setProperty("username", username);  }
        if (password != null) {  props.setProperty("password", password);  }
        if (minConnections != null) {  props.setProperty("minConnections", minConnections);  }
        if (maxConnections != null) {  props.setProperty("maxConnections", maxConnections);  }
        if (logPath != null) {  props.setProperty("logPath", logPath);  }
        if (connectionTimeout != null) {  props.setProperty("connectionTimeout", connectionTimeout);  }
    }

    private void saveProperties() {
        PropertyManager.setProperty("DbConnectionDefaultPool.driver", props.getProperty("driver"));
        PropertyManager.setProperty("DbConnectionDefaultPool.server", props.getProperty("server"));
        PropertyManager.setProperty("DbConnectionDefaultPool.username", props.getProperty("username"));
        PropertyManager.setProperty("DbConnectionDefaultPool.password", props.getProperty("password"));
        PropertyManager.setProperty("DbConnectionDefaultPool.minConnections", props.getProperty("minConnections"));
        PropertyManager.setProperty("DbConnectionDefaultPool.maxConnections", props.getProperty("maxConnections"));
        PropertyManager.setProperty("DbConnectionDefaultPool.logPath", props.getProperty("logPath"));
        PropertyManager.setProperty("DbConnectionDefaultPool.connectionTimeout", props.getProperty("connectionTimeout"));
    }

    /**
     * DbConnectionBroker
     * @version 1.0.11 12/7/99
     * @author Marc A. Mnich
     *
     * ----------------------------------------
     * Modified June 18, 2000 by Matt Tucker
     *   Changes:
     *     - New package name, class name to make it nice to embed as
     *        an internal class.
     *     - Source code reformatting.
     *     - Added more error handling code in constructor, createConn method
     *       so that more information is given to Yazd users.
     * DbConnectionBroker rules! Download it from javaexchange.com
     * ----------------------------------------

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩美女视频在线| 91蝌蚪国产九色| 成人在线视频一区二区| 国产精品久久久久aaaa樱花| 91色九色蝌蚪| 国产一区二区在线观看视频| 中文字幕日韩一区| 欧美xxx久久| 91高清视频在线| 国产精品主播直播| 麻豆精品在线播放| 亚洲欧美色图小说| 久久久久久久综合色一本| 欧美日韩在线不卡| 97se狠狠狠综合亚洲狠狠| 精一区二区三区| 亚洲图片自拍偷拍| 国产精品久久久久久久久久免费看 | 欧美精品777| 99久久99久久综合| 国产.精品.日韩.另类.中文.在线.播放| 亚洲成人免费在线观看| 亚洲男人天堂av| 欧美国产成人精品| 精品国产一区二区国模嫣然| 91麻豆精品国产自产在线观看一区| www.欧美色图| 国产91精品在线观看| 狠狠色丁香久久婷婷综合丁香| 天天做天天摸天天爽国产一区| 亚洲免费观看高清完整版在线| 欧美极品另类videosde| 精品国产三级a在线观看| 555www色欧美视频| 欧美日韩国产片| 欧美三级在线视频| 欧美三片在线视频观看 | 午夜国产精品影院在线观看| 最新欧美精品一区二区三区| 中文字幕精品三区| 久久久久久麻豆| 国产偷国产偷亚洲高清人白洁| 精品国产一区二区三区av性色 | 日本高清无吗v一区| 成人av免费观看| 国产成人一级电影| 成人av网站在线观看| 国产成都精品91一区二区三| 丁香亚洲综合激情啪啪综合| 国产91精品一区二区麻豆网站| 粗大黑人巨茎大战欧美成人| 成人免费毛片a| 91在线国内视频| 精品国产污污免费网站入口 | 欧美男同性恋视频网站| 欧美高清视频www夜色资源网| 欧美久久久久久蜜桃| 91精品福利在线一区二区三区 | 国产亚洲va综合人人澡精品| 国产婷婷一区二区| 国产精品白丝在线| 亚洲高清不卡在线| 欧美a级理论片| 激情亚洲综合在线| 成人国产电影网| 日本道精品一区二区三区| 欧美综合亚洲图片综合区| 欧美伦理影视网| 精品人在线二区三区| 国产午夜亚洲精品理论片色戒| 国产精品日韩成人| 亚洲国产日韩a在线播放| 蜜臀va亚洲va欧美va天堂| 国产精品正在播放| 欧美性猛交xxxxxx富婆| 欧美成人一区二区三区| 国产精品无码永久免费888| 一区二区欧美视频| 久久99久久99| 91论坛在线播放| 欧美大胆人体bbbb| 1000部国产精品成人观看| 日日夜夜一区二区| 国产精品主播直播| 欧美午夜片在线看| 国产午夜亚洲精品理论片色戒| 一区二区三区欧美在线观看| 免费高清不卡av| 99在线精品一区二区三区| 91精品久久久久久久久99蜜臂| 国产亚洲一区字幕| 日本在线观看不卡视频| 99v久久综合狠狠综合久久| 日韩一区二区在线观看| 国产精品久久久久久久浪潮网站 | 日本在线播放一区二区三区| 蓝色福利精品导航| 麻豆国产欧美一区二区三区| 国产精品91一区二区| 色先锋aa成人| 精品欧美一区二区三区精品久久| 国产精品午夜久久| 亚洲人成电影网站色mp4| 国产综合色在线视频区| 一本色道a无线码一区v| 91精品国产一区二区三区香蕉| 国产欧美一区二区在线| 亚洲高清免费观看| 全国精品久久少妇| 欧美私人免费视频| 国产亚洲精久久久久久| 精彩视频一区二区| 337p亚洲精品色噜噜噜| 一区二区三区鲁丝不卡| 国产一区二三区好的| 在线免费视频一区二区| 精品国产一区二区精华| 免费观看91视频大全| 91欧美一区二区| 2023国产一二三区日本精品2022| 伊人色综合久久天天| 国产成人免费视频网站高清观看视频| 色综合天天做天天爱| 欧美午夜精品理论片a级按摩| 欧美一区二区精品在线| 国产欧美日韩视频在线观看| 美女视频黄 久久| 欧美最新大片在线看 | 国产一二精品视频| 欧美日韩一二区| 日本一区二区成人在线| 秋霞电影一区二区| 色婷婷av一区二区三区大白胸| 久久视频一区二区| 免费成人在线视频观看| 欧洲亚洲国产日韩| 亚洲欧美综合色| 国产盗摄一区二区三区| 国产色综合一区| 国产黄人亚洲片| 成人国产精品免费观看动漫| 日本美女一区二区三区视频| 久久夜色精品国产欧美乱极品| 国产a区久久久| 亚洲444eee在线观看| 精品国精品国产| 国产欧美一区二区精品性色超碰| 美国av一区二区| 91精品在线观看入口| 午夜精品久久久久久久99水蜜桃| 99久久免费精品| 精品国产凹凸成av人导航| 国产一区三区三区| 亚洲精品一线二线三线| 蜜臀av性久久久久蜜臀aⅴ四虎| 欧美日韩国产另类一区| 一区二区三区91| 日韩三级在线免费观看| 青青草原综合久久大伊人精品优势| 欧美色爱综合网| 亚洲超丰满肉感bbw| 欧美挠脚心视频网站| 偷拍一区二区三区四区| 欧美一区二区三区四区五区| 日本色综合中文字幕| 2017欧美狠狠色| 成年人国产精品| 午夜亚洲国产au精品一区二区| 精品久久久久久最新网址| 精品福利一二区| 国产日韩精品视频一区| 2024国产精品视频| 91麻豆精品国产91久久久资源速度| 捆绑调教一区二区三区| 欧美日韩一区高清| 美女视频黄a大片欧美| 亚洲精品一区二区三区影院| 国产一区二区三区黄视频| 日本一区二区三区电影| 91日韩在线专区| 午夜影院久久久| 久久综合99re88久久爱| 国产91丝袜在线播放九色| 国产日本一区二区| 欧美日韩aaaaaa| 精品在线播放午夜| 国产精品视频在线看| 色拍拍在线精品视频8848| 亚洲国产成人精品视频| 日韩欧美亚洲一区二区| 狠狠色2019综合网| 国产精品无圣光一区二区| 日本乱人伦aⅴ精品| 亚洲国产一二三| 在线播放中文一区| 成人免费毛片aaaaa**| 伦理电影国产精品| 国产日产亚洲精品系列| 欧美一区二区三区免费观看视频| 国产自产v一区二区三区c|