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

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

?? mysqldatasource.java

?? jsp數(shù)據(jù)庫(kù)系統(tǒng)
?? JAVA
字號(hào):
/*
   Copyright (C) 2002 MySQL AB

      This program is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published by
      the Free Software Foundation; either version 2 of the License, or
      (at your option) any later version.

      This program is distributed in the hope that it will be useful,
      but WITHOUT ANY WARRANTY; without even the implied warranty of
      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      GNU General Public License for more details.

      You should have received a copy of the GNU General Public License
      along with this program; if not, write to the Free Software
      Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

 */
package com.mysql.jdbc.jdbc2.optional;

import java.io.PrintWriter;
import java.io.Serializable;

import java.sql.SQLException;

import java.util.Properties;

import javax.naming.NamingException;
import javax.naming.Reference;
import javax.naming.Referenceable;
import javax.naming.StringRefAddr;

import javax.sql.DataSource;


/**
 * A JNDI DataSource for a Mysql JDBC connection
 *
 * @author Mark Matthews
 */
public class MysqlDataSource implements DataSource, Referenceable, Serializable {
    /** The driver to create connections with */
    protected static com.mysql.jdbc.Driver mysqlDriver = null;

    static {
        try {
            mysqlDriver = (com.mysql.jdbc.Driver) Class.forName(
                    "com.mysql.jdbc.Driver").newInstance();
        } catch (Exception E) {
            throw new RuntimeException(
                "Can not load Driver class com.mysql.jdbc.Driver");
        }
    }

    /** Log stream */
    protected PrintWriter logWriter = null;

    /** Database Name */
    protected String databaseName = null;

    /** Character Encoding */
    protected String encoding = null;

    /** Hostname */
    protected String hostName = null;

    /** Password */
    protected String password = null;

    /** The profileSql property */
    protected String profileSql = "false";

    /** The JDBC URL */
    protected String url = null;

    /** User name */
    protected String user = null;

    /** Should we construct the URL, or has it been set explicitly */
    protected boolean explicitUrl = false;

    /** Port number */
    protected int port = 3306;

    /**
     * Default no-arg constructor for Serialization
     */
    public MysqlDataSource() {
    }

    /**
     * Creates a new connection using the already configured username and
     * password.
     *
     * @return a connection to the database
     *
     * @throws SQLException if an error occurs
     */
    public java.sql.Connection getConnection() throws SQLException {
        return getConnection(user, password);
    }

    /**
     * Creates a new connection with the given username and password
     *
     * @param userID the user id to connect with
     * @param password the password to connect with
     *
     * @return a connection to the database
     *
     * @throws SQLException if an error occurs
     */
    public java.sql.Connection getConnection(String userID, String password)
        throws SQLException {
        Properties props = new Properties();

        if (userID == null) {
            userID = "";
        }

        if (password == null) {
            password = "";
        }

        props.put("user", userID);
        props.put("password", password);
        props.put("profileSql", getProfileSql());

        return getConnection(props);
    }

    /**
     * Sets the database name.
     *
     * @param dbName the name of the database
     */
    public void setDatabaseName(String dbName) {
        databaseName = dbName;
    }

    /**
     * Gets the name of the database
     *
     * @return the name of the database for this data source
     */
    public String getDatabaseName() {
        return (databaseName != null) ? databaseName : "";
    }

    /**
     * Sets the log writer for this data source.
     *
     * @see javax.sql.DataSource#setLogWriter(PrintWriter)
     */
    public void setLogWriter(PrintWriter output) throws SQLException {
        logWriter = output;
    }

    /**
     * Returns the log writer for this data source
     *
     * @return the log writer for this data source
     */
    public java.io.PrintWriter getLogWriter() {
        return logWriter;
    }

    /**
     * DOCUMENT ME!
     *
     * @param seconds DOCUMENT ME!
     *
     * @throws SQLException DOCUMENT ME!
     */
    public void setLoginTimeout(int seconds) throws SQLException {
    }

    /**
     * Returns the login timeout
     *
     * @return the login timeout
     */
    public int getLoginTimeout() {
        return 0;
    }

    /**
     * Sets the password
     *
     * @param pass the password
     */
    public void setPassword(String pass) {
        password = pass;
    }

    /**
     * Sets the database port.
     *
     * @param p the port
     */
    public void setPort(int p) {
        port = p;
    }

    /**
     * Returns the port number
     *
     * @return the port number
     */
    public int getPort() {
        return port;
    }

    /**
     * Sets the port number
     *
     * @param p the port
     *
     * @see #setPort
     */
    public void setPortNumber(int p) {
        setPort(p);
    }

    /**
     * Returns the port number
     *
     * @return the port number
     */
    public int getPortNumber() {
        return getPort();
    }

    /**
     * Sets the profileSql property
     *
     * @param flag true/false
     */
    public void setProfileSql(String flag) {
        profileSql = flag;
    }

    /**
     * Returns the value for the profileSql property
     *
     * @return the value for the profileSql property
     */
    public String getProfileSql() {
        return profileSql;
    }

    /**
     * Required method to support this class as a <CODE>Referenceable</CODE>.
     *
     * @return a Reference to this data source
     *
     * @throws NamingException if a JNDI error occurs
     */
    public Reference getReference() throws NamingException {
        String factoryName = "com.mysql.jdbc.jdbc2.optional.MysqlDataSourceFactory";
        Reference ref = new Reference(getClass().getName(), factoryName, null);
        ref.add(new StringRefAddr("user", getUser()));
        ref.add(new StringRefAddr("password", password));
        ref.add(new StringRefAddr("serverName", getServerName()));
        ref.add(new StringRefAddr("port", "" + getPort()));
        ref.add(new StringRefAddr("databaseName", getDatabaseName()));
        ref.add(new StringRefAddr("profileSql", getProfileSql()));

        return ref;
    }

    /**
     * Sets the server name.
     *
     * @param serverName the server name
     */
    public void setServerName(String serverName) {
        hostName = serverName;
    }

    /**
     * Returns the name of the database server
     *
     * @return the name of the database server
     */
    public String getServerName() {
        return (hostName != null) ? hostName : "";
    }

    //
    // I've seen application servers use both formats
    // URL or url (doh)
    //

    /**
     * Sets the URL for this connection
     *
     * @param url the URL for this connection
     */
    public void setURL(String url) {
        setUrl(url);
    }

    /**
     * Returns the URL for this connection
     *
     * @return the URL for this connection
     */
    public String getURL() {
        return getUrl();
    }

    /**
     * This method is used by the app server to set the url string specified
     * within the datasource deployment descriptor.  It is discovered using
     * introspection and matches if property name in descriptor is "url".
     *
     * @param url url to be used within driver.connect
     */
    public void setUrl(String url) {
        this.url = url;
        explicitUrl = true;
    }

    /**
     * Returns  the   JDBC URL that will be used to create the database
     * connection.
     *
     * @return the URL for this connection
     */
    public String getUrl() {
        if (!explicitUrl) {
            String builtUrl = "jdbc:mysql://";
            builtUrl = builtUrl + getServerName() + ":" + getPort() + "/"
                + getDatabaseName();

            return builtUrl;
        } else {
            return this.url;
        }
    }

    /**
     * Sets the user ID.
     *
     * @param userID the User ID
     */
    public void setUser(String userID) {
        user = userID;
    }

    /**
     * Returns the  configured user for this connection
     *
     * @return the user for this connection
     */
    public String getUser() {
        return user;
    }

    /**
     * Creates a connection using the specified properties.
     *
     * @param props the properties to connect with
     *
     * @return a connection to the database
     *
     * @throws SQLException if an error occurs
     */
    protected java.sql.Connection getConnection(Properties props)
        throws SQLException {
        String jdbcUrlToUse = null;

        if (!explicitUrl) {
            StringBuffer jdbcUrl = new StringBuffer("jdbc:mysql://");

            if (hostName != null) {
                jdbcUrl.append(hostName);
            }

            jdbcUrl.append(":");
            jdbcUrl.append(port);
            jdbcUrl.append("/");

            if (databaseName != null) {
                jdbcUrl.append(databaseName);
            }

            jdbcUrlToUse = jdbcUrl.toString();
        } else {
            jdbcUrlToUse = this.url;
        }

        return mysqlDriver.connect(jdbcUrlToUse, props);
    }
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲精品国产第一综合99久久| 中文字幕日本不卡| 国产精品亚洲第一区在线暖暖韩国| 国产精品素人视频| 欧美婷婷六月丁香综合色| 国产真实乱子伦精品视频| 夜夜夜精品看看| 欧美日韩国产123区| 97久久人人超碰| 天堂午夜影视日韩欧美一区二区| 国产精品乱码人人做人人爱| 91精品一区二区三区在线观看| 99精品黄色片免费大全| 日本va欧美va精品发布| 国产精品女同一区二区三区| 欧美不卡在线视频| 91浏览器打开| 成人av高清在线| 久久成人av少妇免费| 午夜av一区二区| 综合亚洲深深色噜噜狠狠网站| 欧美日韩综合在线免费观看| av欧美精品.com| 黑人精品欧美一区二区蜜桃| 美腿丝袜亚洲三区| 亚洲自拍与偷拍| 亚洲欧美日韩国产中文在线| 久久久久97国产精华液好用吗 | 美女脱光内衣内裤视频久久影院| 18欧美乱大交hd1984| 亚洲国产激情av| 久久久久久久久久看片| 精品剧情v国产在线观看在线| 欧美丝袜自拍制服另类| jlzzjlzz亚洲日本少妇| 成人黄色一级视频| 国产麻豆9l精品三级站| 国产盗摄女厕一区二区三区 | 亚洲精品菠萝久久久久久久| 国产精品久久久久久久久免费丝袜| 日韩午夜精品电影| 日韩精品一区二区在线| 91精品婷婷国产综合久久性色 | 久久久久久**毛片大全| 精品999久久久| 精品国产一区二区三区不卡 | 91美女片黄在线| 91色综合久久久久婷婷| voyeur盗摄精品| 91一区在线观看| 91色视频在线| 欧美日韩一区二区三区四区| 99精品偷自拍| 99国产精品久久久| 色综合久久66| 欧美午夜精品一区二区蜜桃 | 日韩三级电影网址| 欧美一卡二卡在线| 久久精品亚洲精品国产欧美| 久久先锋资源网| 亚洲视频网在线直播| 亚洲日本丝袜连裤袜办公室| 天天色图综合网| 青青青爽久久午夜综合久久午夜| 国产一区二区中文字幕| 国产成人免费在线观看不卡| 91蝌蚪porny九色| 在线国产电影不卡| 精品日韩一区二区三区免费视频| 久久男人中文字幕资源站| 亚洲色欲色欲www在线观看| 一区二区三区在线免费观看| 青娱乐精品视频| 国产激情偷乱视频一区二区三区| 91小视频免费观看| 欧美日韩国产美女| 久久香蕉国产线看观看99| 中文字幕亚洲在| 国产精品欧美一级免费| 图片区小说区国产精品视频| 久久精品久久综合| 99久久免费精品高清特色大片| 精品视频在线看| 国产人成一区二区三区影院| 亚洲乱码中文字幕| 精品一区二区三区在线观看国产| 成人深夜在线观看| 91麻豆精品国产91久久久使用方法| 久久久久久久网| 亚洲人午夜精品天堂一二香蕉| 五月天激情综合网| 麻豆成人在线观看| 色久综合一二码| 日韩精品一区二| 亚洲电影中文字幕在线观看| 精品一区二区三区免费播放| 在线免费观看一区| 精品国内二区三区| 性欧美疯狂xxxxbbbb| 国产乱子伦视频一区二区三区| 欧美军同video69gay| 国产亚洲欧美激情| 男人的j进女人的j一区| 99久久婷婷国产| 久久精品人人做| 日韩高清一区在线| 国产一区高清在线| 这里是久久伊人| 欧美xxxx老人做受| 首页国产丝袜综合| www.亚洲在线| 国产日韩欧美制服另类| 天堂av在线一区| 欧美综合一区二区三区| 中文一区二区在线观看| 黄色小说综合网站| 91精品婷婷国产综合久久竹菊| 夜夜操天天操亚洲| 99久久99久久精品免费看蜜桃| 国产亚洲欧洲997久久综合 | 在线视频一区二区三区| 国产精品成人网| 韩国视频一区二区| 精品欧美一区二区久久| 五月激情六月综合| 精品视频一区三区九区| 亚洲男人的天堂在线aⅴ视频| av一区二区三区黑人| 精品粉嫩超白一线天av| 久久成人av少妇免费| 正在播放亚洲一区| 日韩av电影天堂| 欧美视频一区二区三区在线观看 | 日本成人中文字幕| 欧美日韩国产精选| 午夜精品免费在线| 在线观看欧美日本| 亚洲国产一区二区三区 | 国产色综合久久| 久久99精品久久久| 精品国精品国产尤物美女| 久久se精品一区二区| 国产a级毛片一区| 中文字幕一区日韩精品欧美| 国产成人免费视频| 国产精品女同一区二区三区| 成人午夜免费视频| 亚洲欧美另类在线| 91官网在线观看| 亚洲不卡一区二区三区| 欧美日韩在线免费视频| 美国一区二区三区在线播放| 91精品国产综合久久精品麻豆| 日韩av成人高清| 精品剧情v国产在线观看在线| 国产黄色精品视频| 国产精品区一区二区三区| 91黄色激情网站| 亚洲综合激情另类小说区| 91精品麻豆日日躁夜夜躁| 日韩高清欧美激情| 日韩免费观看高清完整版| 老鸭窝一区二区久久精品| 日韩精品专区在线影院重磅| 国产精品自拍三区| 国产精品久久久久aaaa樱花| 色悠久久久久综合欧美99| 日韩一区精品字幕| 欧美日韩国产在线观看| 精品一区二区三区久久久| 国产日产亚洲精品系列| 91黄色激情网站| 麻豆精品视频在线| 中文字幕一区二区三中文字幕| 91亚洲精品久久久蜜桃网站| 视频在线观看91| 91精品国模一区二区三区| 成人丝袜视频网| 亚洲欧美日韩国产中文在线| 91麻豆精品国产91久久久久久久久| 亚洲图片欧美色图| 国产亚洲一区二区在线观看| 国产91精品一区二区麻豆亚洲| 亚洲一区二区欧美日韩| 欧美一区欧美二区| gogo大胆日本视频一区| 亚洲国产精品久久久久秋霞影院 | 亚洲一区二区高清| 欧美大胆一级视频| 91国产免费看| 久久91精品久久久久久秒播| 亚洲自拍偷拍欧美| 精品精品国产高清一毛片一天堂| 色婷婷综合久久久久中文一区二区 | 欧美第一区第二区| 91在线国产观看| 国产福利视频一区二区三区| 亚洲午夜免费电影| 中文字幕永久在线不卡| 欧美三电影在线|