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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? typeset.java

?? 一個java方面的消息訂閱發送的源碼
?? 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: TypeSet.java,v 1.1 2004/11/26 01:51:16 tanderson Exp $
 */

package org.exolab.jms.tools.db;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import org.exolab.jms.persistence.PersistenceException;
import org.exolab.jms.persistence.SQLHelper;


/**
 * A helper class for managing the set of types supported by an RDBMS
 *
 * @version     $Revision: 1.1 $ $Date: 2004/11/26 01:51:16 $
 * @author      <a href="mailto:tima@intalio.com">Tim Anderson</a>
 */
class TypeSet {

    /**
     * A map of type identifiers to an ArrayList of corresponding RDBMS types
     */
    private HashMap _types = new HashMap();

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


    /**
     * Construct a new instance
     *
     * @param connection the database connection to obtain meta-data from
     * @throws PersistenceException if meta-data cannot be accessed
     */
    public TypeSet(Connection connection) throws PersistenceException {
        ResultSet set = null;
        try {
            set = connection.getMetaData().getTypeInfo();
            while (set.next()) {
                int type = set.getInt("DATA_TYPE");
                String name = set.getString("TYPE_NAME");
                long precision = set.getLong("PRECISION");
                String createParams = set.getString("CREATE_PARAMS");

                Descriptor descriptor = Descriptor.getDescriptor(type);
                if (descriptor != null) {
                    addType(type, name, precision, createParams);
                } else {
                    _log.debug(
                        "TypeSet: skipping unknown type, type id=" + type
                        + ", name=" + name + ", precision=" + precision
                        + ", create params=" + createParams);
                }
            }
        } catch (SQLException exception) {
            throw new PersistenceException(
                "Failed to get type meta-data", exception);
        } finally {
            SQLHelper.close(set);
        }
    }

    /**
     * Return the closest type matching the requested type id and precision
     *
     * @param type the type identifier
     * @param precision the requested precision
     * @return the closest matching type, or null if none exists
     */
    public Type getType(int type, long precision) {
        Type result = null;
        ArrayList types = (ArrayList) _types.get(new Integer(type));
        if (types != null) {
            Iterator iter = types.iterator();
            while (iter.hasNext()) {
                Type option = (Type) iter.next();
                if (precision == -1 && (option.getPrecision() != -1 &&
                    option.getParameters())) {
                    // no precision was requested, but the type requires
                    // parameters
                    result = new Type(type, option.getName(),
                        option.getPrecision(),
                        option.getParameters());
                    break;
                } else if (precision <= option.getPrecision()) {
                    // use the requested precision
                    result = new Type(type, option.getName(), precision,
                        option.getParameters());
                    break;
                } else {
                    _log.debug("TypeSet: requested type=" + type
                        + " exceeds precision for supported " + option);
                }
            }
        } else {
            _log.debug("TypeSet: no types matching type id=" + type
                + ", type=" + Descriptor.getDescriptor(type).getName());
        }
        return result;
    }

    /**
     * Return the near type matching the supplied type id and precision.
     * This should only be invoked if the requested precision exceeds that
     * supported by the database.
     *
     * @param type the type identifier
     * @return the type, or null, if none exists
     */
    public Type getNearestType(int type, long precision) {
        Type result = null;
        ArrayList types = (ArrayList) _types.get(new Integer(type));
        if (types != null) {
            Iterator iter = types.iterator();
            Type nearest = null;
            while (iter.hasNext()) {
                Type option = (Type) iter.next();
                if (precision <= option.getPrecision()) {
                    // use the requested precision
                    result = new Type(type, option.getName(), precision,
                        option.getParameters());
                    break;
                } else {
                    nearest = option;
                }
            }
            if (result == null && nearest != null) {
                // use the closest precision
                result = new Type(type, nearest.getName(),
                    nearest.getPrecision(),
                    nearest.getParameters());
                _log.warn(
                    "TypeSet: requested type=" + type + ", precision="
                    + precision + " exceeds precision supported by database. "
                    + "Falling back to " + nearest);
            }
        } else {
            _log.debug("TypeSet: no types matching type id=" + type
                + ", type=" + Descriptor.getDescriptor(type).getName());
        }
        return result;
    }

    /**
     * Returns true if the type is supported
     *
     * @param type the type identifier
     * @return <code>true</code> if the type is supported
     */
    public boolean exists(int type) {
        return _types.containsKey(new Integer(type));
    }


    private void addType(int type, String name, long precision,
                         String createParams) {
        Descriptor descriptor = Descriptor.getDescriptor(type);
        boolean parameters = false;
        if (createParams != null && createParams.trim().length() != 0) {
            parameters = true;
        }

        Integer key = new Integer(type);
        ArrayList types = (ArrayList) _types.get(key);
        if (types == null) {
            types = new ArrayList();
            _types.put(key, types);
        }

        _log.debug("TypeSet: type id=" + type
            + ", type=" + descriptor.getName()
            + ", name=" + name
            + ", precision=" + precision
            + ", createParams=" + createParams);
        types.add(new Type(type, name, precision, parameters));
    }

} //-- TypeSet

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产**成人网毛片九色| 精品日本一线二线三线不卡| 在线观看欧美黄色| 欧美tickle裸体挠脚心vk| 国产精品久久久久久久久动漫 | 99视频精品免费视频| 91精品国产综合久久久久久漫画| 国产精品欧美经典| 久久成人久久鬼色| 在线91免费看| 亚洲国产日韩综合久久精品| 成人丝袜18视频在线观看| 日韩美女在线视频| 午夜精品久久久久久久久久久 | 久久久国产精品不卡| 丝袜脚交一区二区| 在线观看亚洲a| 亚洲人123区| 成人精品高清在线| 国产日韩一级二级三级| 紧缚捆绑精品一区二区| 3d动漫精品啪啪1区2区免费 | 久久九九久精品国产免费直播| 香蕉成人伊视频在线观看| 91网站最新网址| 国产精品污网站| 粉嫩久久99精品久久久久久夜| 欧美变态口味重另类| 美女mm1313爽爽久久久蜜臀| 欧美日韩精品欧美日韩精品一综合| 亚洲欧洲精品成人久久奇米网| 粉嫩一区二区三区在线看| 欧美国产成人在线| 国产.欧美.日韩| 一区二区中文字幕在线| 99精品黄色片免费大全| 亚洲日本中文字幕区| 色激情天天射综合网| 亚洲国产日韩a在线播放| 欧美日韩三级在线| 美女精品自拍一二三四| 欧美zozozo| 国产福利一区二区| 国产精品午夜免费| 91女神在线视频| 亚洲综合精品自拍| 777xxx欧美| 国内一区二区在线| 国产精品成人网| 91久久精品一区二区| 午夜视频在线观看一区二区| 欧美本精品男人aⅴ天堂| 国产精品一级二级三级| 亚洲欧美日韩国产综合| 欧美精品日韩精品| 黑人精品欧美一区二区蜜桃 | 国产精品综合久久| 亚洲视频一二三区| 3atv一区二区三区| 国产成人av一区二区| 亚洲黄色小视频| 欧美成人精品二区三区99精品| 国产91精品一区二区麻豆网站| 亚洲精选一二三| 日韩免费高清视频| 91片在线免费观看| 天天操天天色综合| 久久久亚洲精品石原莉奈| 91美女在线视频| 蜜桃精品在线观看| 亚洲人成电影网站色mp4| 欧美肥妇bbw| 成+人+亚洲+综合天堂| 亚洲一区二区偷拍精品| 国产日韩欧美在线一区| 欧美性一区二区| 成人午夜激情片| 青青草97国产精品免费观看| 国产精品午夜久久| 日韩视频在线永久播放| 972aa.com艺术欧美| 极品少妇xxxx精品少妇| 亚洲综合丁香婷婷六月香| 久久九九全国免费| 日韩写真欧美这视频| 91美女精品福利| 国产suv精品一区二区6| 欧美96一区二区免费视频| 中文字幕亚洲不卡| 久久亚洲一级片| 欧美一级生活片| 在线观看国产日韩| 91麻豆国产福利在线观看| 国产露脸91国语对白| 另类小说综合欧美亚洲| 亚洲成人自拍偷拍| 一区二区三区四区视频精品免费 | 久久综合久色欧美综合狠狠| 91精品国产色综合久久不卡电影 | 国产成人免费网站| 久久精品国产一区二区三区免费看| 亚洲人成小说网站色在线| 中文在线资源观看网站视频免费不卡| 欧美精品1区2区| 欧洲一区二区三区免费视频| av色综合久久天堂av综合| 国产a级毛片一区| 国产老妇另类xxxxx| 极品美女销魂一区二区三区| 免费成人在线观看| 免费高清在线一区| 日韩精品久久理论片| 日韩精品一二三| 日本不卡高清视频| 免费人成在线不卡| 久久成人免费网| 麻豆一区二区三区| 精品一区二区三区在线观看 | 国产精品理论在线观看| 国产日韩v精品一区二区| 久久久久9999亚洲精品| 中文字幕高清不卡| 亚洲欧美在线观看| 一区二区免费看| 三级亚洲高清视频| 蜜桃视频第一区免费观看| 久久国产精品99精品国产| 麻豆一区二区三| 国产高清成人在线| 99re热视频这里只精品| 一本一道久久a久久精品| 色就色 综合激情| 欧美男生操女生| 欧美成人精品二区三区99精品| 久久亚洲精精品中文字幕早川悠里 | 亚洲丝袜自拍清纯另类| 亚洲精品国产精品乱码不99| 视频在线观看一区| 久久成人免费电影| 国产成人av福利| 色综合色狠狠天天综合色| 8x8x8国产精品| 精品国产一区二区精华 | 日韩视频免费观看高清完整版 | 制服.丝袜.亚洲.另类.中文 | 精品在线一区二区三区| 国产91综合一区在线观看| 一本在线高清不卡dvd| 欧美一级片在线| 国产清纯美女被跳蛋高潮一区二区久久w | 欧美在线视频全部完| 欧美一二三区精品| 中文子幕无线码一区tr| 亚洲大片精品永久免费| 国产91在线|亚洲| 777午夜精品免费视频| 国产欧美日韩在线视频| 亚洲综合免费观看高清完整版在线 | 欧美一级二级在线观看| 国产精品国产a| 麻豆国产91在线播放| 91久久精品日日躁夜夜躁欧美| 精品成人a区在线观看| 一片黄亚洲嫩模| 国产成人精品影视| 日韩无一区二区| 亚洲成人先锋电影| 成人黄动漫网站免费app| 7777精品伊人久久久大香线蕉最新版| 欧美国产国产综合| 麻豆成人91精品二区三区| 91免费国产在线| 国产婷婷精品av在线| 免费成人性网站| 欧美日韩在线播放一区| 综合中文字幕亚洲| 国产福利视频一区二区三区| 91麻豆精品国产91久久久久| 一区二区在线观看免费 | 久久久蜜臀国产一区二区| 丝袜美腿亚洲一区| 91电影在线观看| 国产日产精品一区| 国产在线国偷精品免费看| 欧美一区二区在线看| 亚洲精品伦理在线| www.日本不卡| 日本一区二区三区四区| 久久 天天综合| 欧美一区二区三区在线电影| 亚洲五码中文字幕| 在线观看亚洲一区| 亚洲靠逼com| 欧美影视一区在线| 亚洲最大成人网4388xx| 在线免费观看日本一区| 亚洲一区二区三区小说| 欧美私人免费视频| 亚洲午夜电影在线观看| 精品视频在线免费看|