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

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

?? dbtool.java

?? 一個java方面的消息訂閱發(fā)送的源碼
?? JAVA
字號:
/**
 * Redistribution and use of this software and associated documentation
 * ("Software"), with or without modification, are permitted provided
 * that the following conditions are met:
 *
 * 1. Redistributions of source code must retain copyright
 *    statements and notices.  Redistributions must also contain a
 *    copy of this document.
 *
 * 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 name "Exolab" must not be used to endorse or promote
 *    products derived from this Software without prior written
 *    permission of Exoffice Technologies.  For written permission,
 *    please contact info@exolab.org.
 *
 * 4. Products derived from this Software may not be called "Exolab"
 *    nor may "Exolab" appear in their names without prior written
 *    permission of Exoffice Technologies. Exolab is a registered
 *    trademark of Exoffice Technologies.
 *
 * 5. Due credit should be given to the Exolab Project
 *    (http://www.exolab.org/).
 *
 * THIS SOFTWARE IS PROVIDED BY EXOFFICE TECHNOLOGIES AND CONTRIBUTORS
 * ``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
 * EXOFFICE TECHNOLOGIES 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.
 *
 * Copyright 2001,2003 (C) Exoffice Technologies Inc. All Rights Reserved.
 *
 * $Id: DBTool.java,v 1.1 2004/11/26 01:51:15 tanderson Exp $
 */

package org.exolab.jms.tools.db;

import java.io.IOException;
import java.sql.Connection;
import java.sql.SQLException;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.log4j.xml.DOMConfigurator;

import org.exolab.castor.xml.MarshalException;
import org.exolab.castor.xml.ValidationException;
import org.exolab.jms.config.Configuration;
import org.exolab.jms.config.ConfigurationFileException;
import org.exolab.jms.config.ConfigurationManager;
import org.exolab.jms.config.FileDoesNotExistException;
import org.exolab.jms.config.RdbmsDatabaseConfiguration;
import org.exolab.jms.persistence.DBCPConnectionManager;
import org.exolab.jms.persistence.DBConnectionManager;
import org.exolab.jms.persistence.PersistenceException;
import org.exolab.jms.persistence.RDBMSAdapter;
import org.exolab.jms.util.CommandLine;


/**
 * This class provides support for creating and destroying OpenJMS tables
 * in RDBMS databases.
 *
 * @version     $Revision: 1.1 $ $Date: 2004/11/26 01:51:15 $
 * @author      <a href="mailto:tima@intalio.com">Tim Anderson</a>
 */
public class DBTool {

    /**
     * The connection manager
     */
    private DBConnectionManager _connections;

    /**
     * The RDBMS tool
     */
    private RDBMSTool _tool;

    /**
     * The logger
     */
    private static final Log _log = LogFactory.getLog(DBTool.class);


    /**
     * Construct an instance with the path to an openjms XML configuration file
     *
     * @param path the path to an openjms XML configuration file
     * @throws ClassNotFoundException if the JDBC driver cannot be loaded
     * @throws ConfigurationFileException if the configuration file is invalid
     * @throws FileDoesNotExistException if the file cannot be found
     * @throws IOException if the RDBMS configuration contains invalid
     * values for the paths element
     * @throws IllegalArgumentException if path is null
     * @throws PersistenceException if a connection cannot be established
     */
    public DBTool(String path)
        throws ClassNotFoundException, ConfigurationFileException,
        FileDoesNotExistException, IOException,
        PersistenceException {

        if (path == null) {
            throw new IllegalArgumentException("Argument 'path' is null");
        }

        ConfigurationManager.setConfig(path);
        Configuration config = ConfigurationManager.getConfig();
        DOMConfigurator.configure(config.getLoggerConfiguration().getFile());
        RdbmsDatabaseConfiguration rdbms =
            config.getDatabaseConfiguration().getRdbmsDatabaseConfiguration();
        if (rdbms == null) {
            throw new ConfigurationFileException(
                "Configuration file=" + path + " is not configured to use an" +
                " RDBMS");
        }
        _connections = new DBCPConnectionManager();
        _connections.setDriver(rdbms.getDriver());
        _connections.setURL(rdbms.getUrl());
        _connections.setUser(rdbms.getUser());
        _connections.setPassword(rdbms.getPassword());
        _connections.init();
        _tool = new RDBMSTool(_connections.getConnection());
    }

    /**
     * Creates the database tables using the default schema
     *
     * @throws PersistenceException if the tables cannot be created
     */
    public void create() throws PersistenceException {
        Database schema = SchemaHelper.getSchema();
        _tool.create(schema);
    }

    /**
     * Creates the database tables from the specified schema
     *
     * @param path the path to an XML database schema file
     * @throws PersistenceException if the tables cannot be created
     */
    public void create(String path) throws PersistenceException {
        if (path == null) {
            throw new IllegalArgumentException("Argument 'path' is null");
        }
        Database schema = SchemaHelper.getSchema(path);
        _tool.create(schema);
    }

    /**
     * Drop the database tables from the default schema
     *
     * @throws PersistenceException if the tables cannot be dropped
     */
    public void drop() throws PersistenceException {
        Database schema = SchemaHelper.getSchema();
        _tool.drop(schema);
    }

    /**
     * Drop the database tables from the specified schema
     *
     * @param path the path to an XML database schema file
     * @throws PersistenceException if the tables cannot be dropped
     */
    public void drop(String path) throws PersistenceException {
        if (path == null) {
            throw new IllegalArgumentException("Argument 'path' is null");
        }
        Database schema = SchemaHelper.getSchema(path);
        _tool.drop(schema);
    }

    /**
     * Migrates the database tables to the latest version
     *
     * @throws PersistenceException if the database cannot be migrated
     */
    public void migrate() throws PersistenceException {
        Connection connection = _connections.getConnection();
        Database schema = SchemaHelper.getSchema();

        String fromVersion = SchemaHelper.getSchemaVersion(connection);
        if (fromVersion == null) {
            throw new PersistenceException(
                "Cannot migrate schema - existing schema version cannot be "
                + "determined");
        }
        String toVersion = RDBMSAdapter.SCHEMA_VERSION;
        SchemaConverter converter =
            SchemaConverterFactory.create(fromVersion, toVersion, connection);
        if (converter != null) {
            try {
                _log.info("Migrating schema from version=" +
                    fromVersion + " to version=" + toVersion);
                converter.convert();
                _log.info("Successfully migrated schema");
            } catch (PersistenceException exception) {
                _log.error(
                    "Schema migration from version=" + fromVersion +
                    " to version=" + toVersion + " failed",
                    exception);
                throw exception;
            }
        } else {
            throw new PersistenceException(
                "Incompatible schema types. Expected schema version=" +
                fromVersion + ", but got schema version=" + toVersion);
        }
    }

    /**
     * Deallocate any resources
     *
     * @throws SQLException if the database connection cannot be closed
     */
    public void close() throws SQLException {
        _tool.close();
    }

    public static void main(String args[]) {
        CommandLine commands = new CommandLine(args);

        DBTool tool = null;
        String config = commands.value("config");
        if (config != null) {
            try {
                tool = new DBTool(config);
            } catch (Exception exception) {
                _log.error(exception, exception);
                System.exit(1);
            }
        } else {
            usage();
            System.exit(1);
        }
        boolean create = commands.exists("create");
        boolean drop = commands.exists("drop");
        boolean recreate = commands.exists("recreate");
        boolean migrate = commands.exists("migrate");
        String schema = commands.value("schema");
        if (create) {
            try {
                if (schema != null) {
                    tool.create(schema);
                } else {
                    tool.create();
                }
                System.out.println("Successfully created tables");
            } catch (Exception exception) {
                _log.error(exception, exception);
                System.exit(1);
            }
        } else if (drop) {
            try {
                if (schema != null) {
                    tool.drop(schema);
                } else {
                    tool.drop();
                }
                System.out.println("Successfully dropped tables");
            } catch (Exception exception) {
                _log.error(exception, exception);
                System.exit(1);
            }
        } else if (recreate) {
            try {
                if (schema != null) {
                    tool.drop(schema);
                    tool.create(schema);
                } else {
                    tool.drop();
                    tool.create();
                }
                System.out.println("Successfully recreated tables");
            } catch (Exception exception) {
                _log.error(exception, exception);
                System.exit(1);
            }
        } else if (migrate) {
            try {
                tool.migrate();
            } catch (Exception exception) {
                _log.error(exception, exception);
                System.exit(1);
            }
            System.out.println("Sucessfully migrated database");
        } else {
            usage();
            System.exit(1);
        }
        try {
            tool.close();
        } catch (Exception exception) {
            _log.error(exception, exception);
        }
    }

    /**
     * Displays usage information for this tool when invoked from the
     * command line
     */
    private static void usage() {
        System.err.println(
            "usage: " + DBTool.class.getName() + " <arguments> [options]\n" +
            "arguments:\n" +
            "  -create -config <path>   creates the database tables\n" +
            "  -drop -config <path>     drops the database tables\n\n" +
            "  -recreate -config <path> recreates the database tables\n\n" +
            "  -migrate -config <path>  migrates the database to the latest "
            + "schema version\n\n" +
            "options:\n" +
            "  -schema <schema>\n");
        System.err.println(
            "where:\n" +
            "  path      is the path to an OpenJMS configuration file\n" +
            "  schema    is an XML document specifying the database schema\n" +
            "            If not specified, the default schema will be used");
    }

} //-- DBTool

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色噜噜狠狠色综合欧洲selulu| 极品少妇xxxx精品少妇偷拍| 调教+趴+乳夹+国产+精品| 全国精品久久少妇| 91在线高清观看| 久久综合网色—综合色88| 亚洲综合男人的天堂| 成人午夜大片免费观看| 日韩欧美中文一区二区| 精品久久久久香蕉网| 亚洲色图视频网| 日韩精品免费专区| 丁香婷婷综合五月| 91精品午夜视频| 亚洲乱码国产乱码精品精98午夜| 久久99久久99精品免视看婷婷| 欧美亚洲图片小说| 亚洲免费伊人电影| 成人午夜视频在线观看| 精品国产免费一区二区三区四区| 亚洲影院在线观看| 在线观看国产日韩| 亚洲欧美另类久久久精品2019| 国产ts人妖一区二区| 久久久激情视频| 国产精品亚洲一区二区三区妖精| 日韩免费电影网站| 日本不卡免费在线视频| 91精品国产美女浴室洗澡无遮挡| 中文字幕精品三区| 亚洲曰韩产成在线| 在线播放91灌醉迷j高跟美女| 久久精品一二三| 国产一区二区在线电影| 久久这里只有精品6| 久久99国产精品久久99果冻传媒| 欧美一区二区三区的| 日韩成人一区二区| 日韩欧美另类在线| 国产精品自拍在线| 国产女人水真多18毛片18精品视频| 国产老肥熟一区二区三区| 久久综合狠狠综合久久综合88 | 日韩视频免费观看高清完整版 | 久久精品亚洲精品国产欧美kt∨ | 国产揄拍国内精品对白| 久久国产精品露脸对白| 欧美日韩国产美女| 日韩丝袜情趣美女图片| 男人操女人的视频在线观看欧美 | 国产精品1区二区.| 亚洲国产精品二十页| 99国产欧美另类久久久精品| 国产精品美女久久久久久 | 精品视频1区2区| 日韩成人一级片| 久久只精品国产| 成人h精品动漫一区二区三区| 专区另类欧美日韩| 日本不卡不码高清免费观看| 暴力调教一区二区三区| 一区二区三区四区在线播放| 91蜜桃视频在线| 亚洲欧美日韩国产另类专区| 国产精品色呦呦| 国产精品国产自产拍高清av | 亚洲国产精品欧美一二99| 亚洲视频免费在线| 亚洲少妇30p| 精品一区二区三区影院在线午夜 | 日韩中文字幕91| 精品系列免费在线观看| 国产精品午夜免费| 日韩1区2区日韩1区2区| 色成人在线视频| 亚洲午夜精品一区二区三区他趣| 欧美日韩一级视频| 国产在线国偷精品产拍免费yy| 国产精品美女一区二区| 欧美精品久久久久久久多人混战| 国产精品一区在线观看你懂的| 一区二区三区日韩精品视频| 精品99久久久久久| 在线一区二区三区四区五区| 久久av资源网| 亚洲国产欧美在线人成| 欧美激情一区在线| 91麻豆精品国产自产在线观看一区| 丰满岳乱妇一区二区三区 | 日韩精品在线网站| 色综合夜色一区| 99久久777色| 久久激情五月激情| 亚洲动漫第一页| 成人免费在线播放视频| 色综合网色综合| 亚洲夂夂婷婷色拍ww47 | 美美哒免费高清在线观看视频一区二区| 国产亚洲人成网站| 日韩免费一区二区| 欧美日韩成人综合| 欧美性猛交xxxxxxxx| 99精品在线免费| 岛国一区二区在线观看| 久久99精品一区二区三区三区| 亚洲午夜电影在线| 亚洲乱码国产乱码精品精小说| 欧美激情在线观看视频免费| 久久久噜噜噜久噜久久综合| 日韩亚洲欧美在线| 欧美一级日韩不卡播放免费| 欧美精品99久久久**| 欧美日韩国产一级| 在线播放中文字幕一区| 在线电影院国产精品| 精品1区2区3区| 欧美日韩高清在线播放| 欧美久久高跟鞋激| 偷拍自拍另类欧美| 久久综合色一综合色88| 一本高清dvd不卡在线观看| 久久99热狠狠色一区二区| 男男gaygay亚洲| 美女一区二区三区在线观看| 蜜臀av一区二区三区| 寂寞少妇一区二区三区| 精品一二三四在线| 国产精品主播直播| av动漫一区二区| 91免费看视频| 欧美另类变人与禽xxxxx| 91精品国产黑色紧身裤美女| 欧美mv和日韩mv国产网站| 久久影视一区二区| 亚洲国产高清aⅴ视频| 中文字幕永久在线不卡| 亚洲一区在线免费观看| 日韩精品电影一区亚洲| 久久狠狠亚洲综合| 成人av在线观| 欧美视频在线不卡| 精品久久免费看| 国产精品久久久久久久久快鸭| 亚洲综合在线免费观看| 高清免费成人av| 这里只有精品电影| 欧美国产视频在线| 中文字幕一区二区不卡| 欧美精品一区二区精品网| 国产精品每日更新在线播放网址 | 久88久久88久久久| 国产中文字幕一区| 不卡一区二区三区四区| 欧美午夜电影网| 久久久久久久久一| 亚洲精品国产精品乱码不99| 日本系列欧美系列| www.av亚洲| 欧美一级精品大片| 日韩毛片在线免费观看| 日韩成人午夜精品| 不卡视频在线观看| 欧美大片国产精品| 亚洲人xxxx| 欧美丰满少妇xxxbbb| 综合久久给合久久狠狠狠97色 | 亚洲影视在线观看| 久久99国产乱子伦精品免费| 91视频www| 久久蜜桃一区二区| 香蕉久久一区二区不卡无毒影院| 国产成人精品网址| 欧美电影免费观看高清完整版在| 亚洲免费观看高清完整版在线| 黄色成人免费在线| 欧美唯美清纯偷拍| 自拍偷拍国产亚洲| 懂色av一区二区三区免费观看 | 久久免费电影网| 日韩成人精品在线观看| 色综合中文综合网| 国产欧美一区二区精品忘忧草 | 欧美久久一二区| 欧美日韩精品欧美日韩精品一| 亚洲精品国产a久久久久久| 色婷婷久久久亚洲一区二区三区| 亚洲精品在线免费播放| 亚洲一区二区三区四区中文字幕| 国产aⅴ综合色| 精品国产乱码久久久久久蜜臀 | 久久99精品久久久| 欧美日韩中文另类| 成人免费在线播放视频| 成人综合在线观看| 久久精品欧美一区二区三区不卡| 亚洲国产精品一区二区尤物区| 一本到不卡免费一区二区| 国产精品理论片| av在线免费不卡| 亚洲婷婷综合色高清在线|