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

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

?? jdbcdynaclass.java

?? 這是一個(gè)有關(guān)common beanutils 的源碼
?? JAVA
字號(hào):
/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.apache.commons.beanutils;

import java.io.Serializable;
import java.sql.Date;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.sql.Time;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

/**
 * <p>Provides common logic for JDBC implementations of {@link DynaClass}.</p>
 *
 * @author   Craig R. McClanahan
 * @author   George Franciscus
 * @version $Revision: 557031 $ $Date: 2007-07-17 20:12:54 +0100 (Tue, 17 Jul 2007) $
 */

abstract class JDBCDynaClass implements DynaClass, Serializable {

    // ----------------------------------------------------- Instance Variables

    /**
     * <p>Flag defining whether column names should be lower cased when
     * converted to property names.</p>
     */
    protected boolean lowerCase = true;

    /**
     * <p>The set of dynamic properties that are part of this
     * {@link DynaClass}.</p>
     */
    protected DynaProperty[] properties = null;

    /**
     * <p>The set of dynamic properties that are part of this
     * {@link DynaClass}, keyed by the property name.  Individual descriptor
     * instances will be the same instances as those in the
     * <code>properties</code> list.</p>
     */
    protected Map propertiesMap = new HashMap();

    /**
     * Cross Reference for column name --> dyna property name
     * (needed when lowerCase option is true)
     */
    private Map columnNameXref;

    // ------------------------------------------------------ DynaClass Methods

    /**
     * <p>Return the name of this DynaClass (analogous to the
     * <code>getName()</code> method of <code>java.lang.Class</code), which
     * allows the same <code>DynaClass</code> implementation class to support
     * different dynamic classes, with different sets of properties.</p>
     */
    public String getName() {

        return (this.getClass().getName());

    }

    /**
     * <p>Return a property descriptor for the specified property, if it
     * exists; otherwise, return <code>null</code>.</p>
     *
     * @param name Name of the dynamic property for which a descriptor
     *  is requested
     *
     * @exception IllegalArgumentException if no property name is specified
     */
    public DynaProperty getDynaProperty(String name) {

        if (name == null) {
            throw new IllegalArgumentException("No property name specified");
        }
        return ((DynaProperty) propertiesMap.get(name));

    }

    /**
     * <p>Return an array of <code>ProperyDescriptors</code> for the properties
     * currently defined in this DynaClass.  If no properties are defined, a
     * zero-length array will be returned.</p>
     */
    public DynaProperty[] getDynaProperties() {

        return (properties);

    }

    /**
     * <p>Instantiate and return a new DynaBean instance, associated
     * with this DynaClass.  <strong>NOTE</strong> - This operation is not
     * supported, and throws an exception.</p>
     *
     * @exception IllegalAccessException if the Class or the appropriate
     *  constructor is not accessible
     * @exception InstantiationException if this Class represents an abstract
     *  class, an array class, a primitive type, or void; or if instantiation
     *  fails for some other reason
     */
    public DynaBean newInstance()
            throws IllegalAccessException, InstantiationException {

        throw new UnsupportedOperationException("newInstance() not supported");

    }

    /**
     * <p>Loads and returns the <code>Class</code> of the given name.
     * By default, a load from the thread context class loader is attempted.
     * If there is no such class loader, the class loader used to load this
     * class will be utilized.</p>
     *
     * @param className The name of the class to load
     * @return The loaded class
     * @exception SQLException if an exception was thrown trying to load
     *  the specified class
     */
    protected Class loadClass(String className) throws SQLException {

        try {
            ClassLoader cl = Thread.currentThread().getContextClassLoader();
            if (cl == null) {
                    cl = this.getClass().getClassLoader();
            }
            return (cl.loadClass(className));
        } catch (Exception e) {
            throw new SQLException(
                    "Cannot load column class '" + className + "': " + e);
        }

    }

    /**
     * <p>Factory method to create a new DynaProperty for the given index
     * into the result set metadata.</p>
     * 
     * @param metadata is the result set metadata
     * @param i is the column index in the metadata
     * @return the newly created DynaProperty instance
     * @throws SQLException If an error occurs accessing the SQL metadata
     */
    protected DynaProperty createDynaProperty(
                                    ResultSetMetaData metadata,
                                    int i)
                                    throws SQLException {

        String columnName = metadata.getColumnName(i);
        String name = lowerCase ? columnName.toLowerCase() : columnName;
        if (!name.equals(columnName)) {
            if (columnNameXref == null) {
                columnNameXref = new HashMap();
            }
            columnNameXref.put(name, columnName);
        }
        String className = null;
        try {
            int sqlType = metadata.getColumnType(i);
            switch (sqlType) {
                case java.sql.Types.DATE:
                    return new DynaProperty(name, java.sql.Date.class);
                case java.sql.Types.TIMESTAMP:
                    return new DynaProperty(name, java.sql.Timestamp.class);
                case java.sql.Types.TIME:
                    return new DynaProperty(name, java.sql.Time.class);
                default:
                    className = metadata.getColumnClassName(i);
            }
        } catch (SQLException e) {
            // this is a patch for HsqlDb to ignore exceptions
            // thrown by its metadata implementation
        }

        // Default to Object type if no class name could be retrieved
        // from the metadata
        Class clazz = Object.class;
        if (className != null) {
            clazz = loadClass(className);
        }
        return new DynaProperty(name, clazz);

    }

    /**
     * <p>Introspect the metadata associated with our result set, and populate
     * the <code>properties</code> and <code>propertiesMap</code> instance
     * variables.</p>
     *
     * @param resultSet The <code>resultSet</code> whose metadata is to
     *  be introspected
     *
     * @exception SQLException if an error is encountered processing the
     *  result set metadata
     */
    protected void introspect(ResultSet resultSet) throws SQLException {

        // Accumulate an ordered list of DynaProperties
        ArrayList list = new ArrayList();
        ResultSetMetaData metadata = resultSet.getMetaData();
        int n = metadata.getColumnCount();
        for (int i = 1; i <= n; i++) { // JDBC is one-relative!
            DynaProperty dynaProperty = createDynaProperty(metadata, i);
            if (dynaProperty != null) {
                    list.add(dynaProperty);
            }
        }

        // Convert this list into the internal data structures we need
        properties =
            (DynaProperty[]) list.toArray(new DynaProperty[list.size()]);
        for (int i = 0; i < properties.length; i++) {
            propertiesMap.put(properties[i].getName(), properties[i]);
        }

    }

    /**
     * Get a column value from a {@link ResultSet} for the specified name.
     *
     * @param resultSet The result set
     * @param name The property name
     * @return The value
     * @throws SQLException if an error occurs
     */
    protected Object getObject(ResultSet resultSet, String name) throws SQLException {

        DynaProperty property = getDynaProperty(name);
        if (property == null) {
            throw new IllegalArgumentException("Invalid name '" + name + "'");
        }
        String columnName = getColumnName(name);
        Class type = property.getType();

        // java.sql.Date
        if (type.equals(Date.class)) {
            return resultSet.getDate(columnName);
        }

        // java.sql.Timestamp
        if (type.equals(Timestamp.class)) {
            return resultSet.getTimestamp(columnName);
        }

        // java.sql.Time
        if (type.equals(Time.class)) {
            return resultSet.getTime(columnName);
        }

        return resultSet.getObject(columnName);
    }

    /**
     * Get the table column name for the specified property name.
     * 
     * @param name The property name
     * @return The column name (which can be different if the <i>lowerCase</i>
     * option is used).
     */
    protected String getColumnName(String name) {
        if (columnNameXref != null && columnNameXref.containsKey(name)) {
            return (String)columnNameXref.get(name);
        } else {
            return name;
        }
    }

}

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久久亚洲精品石原莉奈| 99久久久免费精品国产一区二区| 精品国产乱码久久久久久老虎| 国产精品亚洲午夜一区二区三区| 中文字幕欧美日本乱码一线二线| 91美女在线观看| 美腿丝袜在线亚洲一区| 国产精品毛片久久久久久久| 在线观看日韩av先锋影音电影院| 精品亚洲国产成人av制服丝袜 | 一本色道久久综合亚洲精品按摩| 午夜电影一区二区三区| 136国产福利精品导航| 精品国产乱码久久久久久久久| 欧美最新大片在线看 | 亚洲综合网站在线观看| 91精品福利视频| 国产一区三区三区| 婷婷久久综合九色综合绿巨人 | 欧美人xxxx| 91黄色小视频| 在线亚洲+欧美+日本专区| 成人免费毛片片v| 国产成人av影院| 激情久久五月天| 精品一区二区三区日韩| 日韩精品久久理论片| 亚洲国产欧美在线人成| 手机精品视频在线观看| 亚洲成人av一区二区三区| 亚洲一区二区美女| 日韩精品一区第一页| 日本成人在线不卡视频| 日韩国产欧美在线播放| 天堂蜜桃一区二区三区| 久久99精品一区二区三区| 极品少妇一区二区三区精品视频| 久久www免费人成看片高清| 精品综合久久久久久8888| 国产麻豆精品在线观看| av在线不卡网| 欧美精品乱码久久久久久| 日韩欧美卡一卡二| 国产精品二三区| 视频一区欧美日韩| 国产成人自拍高清视频在线免费播放| 国产精品乡下勾搭老头1| 色88888久久久久久影院按摩| 在线观看日产精品| 久久九九久久九九| 亚洲人成人一区二区在线观看| 亚洲国产欧美在线| 高清在线成人网| 欧美一区二区三区成人| 中国色在线观看另类| 天天操天天综合网| av在线播放成人| 久久综合色综合88| 日本不卡1234视频| 97国产一区二区| 久久视频一区二区| 日本欧美久久久久免费播放网| 99精品视频在线播放观看| 精品日韩一区二区三区免费视频| 成人欧美一区二区三区在线播放| 日本中文字幕一区二区有限公司| 成人网在线免费视频| 久久久综合视频| 国产一区二区三区蝌蚪| 欧美顶级少妇做爰| 亚洲va中文字幕| 欧美三级中文字| 一区二区三区日韩欧美精品| aaa欧美日韩| 中文字幕一区二区日韩精品绯色| 国产在线观看一区二区 | 色拍拍在线精品视频8848| 色94色欧美sute亚洲线路一久| 欧美电影免费观看高清完整版在| 日韩影院精彩在线| 欧美一级日韩一级| 蜜桃av噜噜一区二区三区小说| 欧美视频一区二区三区在线观看| 亚洲免费在线播放| 欧洲一区二区三区在线| 日韩精品久久久久久| 日韩三级在线观看| 国产一区二区精品久久| 国产三级一区二区三区| 91在线看国产| 亚洲一级二级三级在线免费观看| 欧美日韩国产一级片| 日本aⅴ免费视频一区二区三区 | 91捆绑美女网站| 亚洲一级二级在线| 精品国产成人系列| 不卡视频在线看| 亚洲国产aⅴ天堂久久| 精品免费国产一区二区三区四区| 国产一区999| 亚洲国产精品一区二区尤物区| 日韩一区二区免费高清| thepron国产精品| 天天影视色香欲综合网老头| 国产日本欧洲亚洲| 91精品视频网| 久久综合九色综合97婷婷女人 | 日韩欧美一区在线| 97久久超碰精品国产| 男男gaygay亚洲| 看电影不卡的网站| 一区二区三区精品视频在线| 2023国产精品| 欧美一级电影网站| 欧美色区777第一页| 97久久精品人人澡人人爽| 国内精品在线播放| 久久99日本精品| 亚洲v日本v欧美v久久精品| 亚洲三级在线免费观看| 国产欧美日本一区视频| 精品国产乱码久久久久久浪潮| 欧美一级日韩免费不卡| 欧美日韩色一区| 欧美日韩成人综合天天影院 | 欧美三级蜜桃2在线观看| 成人黄色大片在线观看| 丁香亚洲综合激情啪啪综合| 精品一区二区精品| 麻豆91在线观看| 国模一区二区三区白浆| 韩国三级电影一区二区| 久久99久久精品| 国产精品一区二区在线观看不卡| 麻豆视频一区二区| 国产乱人伦偷精品视频免下载| 精久久久久久久久久久| 国产一区不卡在线| 99re8在线精品视频免费播放| 成人av网址在线| 青青草国产精品97视觉盛宴| 国产欧美日韩在线看| 国产精品久久久久一区二区三区| 国产亚洲综合色| 亚洲精品福利视频网站| 天天亚洲美女在线视频| 国产一区二区三区在线观看精品| 国产91综合一区在线观看| 91丨九色丨蝌蚪富婆spa| 91久久久免费一区二区| 日韩写真欧美这视频| 国产精品看片你懂得| 日韩精品久久理论片| 成人中文字幕合集| 欧美一区二区播放| 国产精品久久久久毛片软件| 亚洲一区在线电影| 国产99一区视频免费| 欧美日本乱大交xxxxx| 中文字幕电影一区| 免费在线观看精品| 在线免费不卡电影| 国产精品久久久久桃色tv| 日本成人中文字幕在线视频| av电影天堂一区二区在线| 日韩欧美色综合| 日韩在线播放一区二区| 日本精品一区二区三区高清| 国产日韩av一区二区| 久久99久久久欧美国产| 欧美日本精品一区二区三区| 亚洲欧美偷拍三级| 99久精品国产| 中文字幕成人av| 国产成人在线免费| 久久久久久久久久久久久女国产乱 | 免费日本视频一区| 6080日韩午夜伦伦午夜伦| 一个色在线综合| 在线看国产一区| 亚洲成av人片在线观看无码| 日本韩国欧美在线| 亚洲电影第三页| 欧美人与禽zozo性伦| 日韩电影网1区2区| 日韩美一区二区三区| 国产美女在线观看一区| 国产喷白浆一区二区三区| 成人av网站免费观看| 一区二区三区四区av| 欧美伦理视频网站| 黄色日韩三级电影| 亚洲欧美在线另类| 色婷婷av一区二区三区大白胸| 一区二区在线观看不卡| 欧美日韩中文精品| 精品在线播放免费| 亚洲天堂精品视频| 欧美日韩一区二区在线观看| 青青草国产成人av片免费|