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

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

?? simpleresultset.java

?? 非常棒的java數(shù)據(jù)庫(kù)
?? JAVA
?? 第 1 頁 / 共 4 頁
字號(hào):
/*
 * Copyright 2004-2008 H2 Group. Licensed under the H2 License, Version 1.0
 * (http://h2database.com/html/license.html).
 * Initial Developer: H2 Group
 */
package org.h2.tools;

import java.io.InputStream;
import java.io.Reader;
import java.math.BigDecimal;
import java.net.URL;
import java.sql.Array;
import java.sql.Blob;
import java.sql.Clob;
import java.sql.Date;
import java.sql.Ref;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.sql.SQLWarning;
import java.sql.Statement;
import java.sql.Time;
import java.sql.Timestamp;
import java.sql.Types;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Map;

//#ifdef JDK16
/*
import java.sql.NClob;
import java.sql.RowId;
import java.sql.SQLXML;
*/
//#endif

/**
 * This class is a simple result set and meta data implementation.
 * It can be used in Java functions that return a result set.
 * Only the most basic methods are implemented, the others throw an exception.
 * This implementation is standalone, and only relies on standard classes.
 * It can be extended easily if required.
 *
 * An application can create a result set using the following code:
 *
 * <pre>
 * SimpleResultSet rs = new SimpleResultSet();
 * rs.addColumn(&quot;ID&quot;, Types.INTEGER, 10, 0);
 * rs.addColumn(&quot;NAME&quot;, Types.VARCHAR, 255, 0);
 * rs.addRow(new Object[] { new Integer(0), &quot;Hello&quot; });
 * rs.addRow(new Object[] { new Integer(1), &quot;World&quot; });
 * </pre>
 *
 */
public class SimpleResultSet implements ResultSet, ResultSetMetaData {

    private ArrayList rows;
    private Object[] currentRow;
    private int rowId = -1;
    private boolean wasNull;
    private SimpleRowSource source;
    private ArrayList columns = new ArrayList();

    private static class Column {
        String name;
        int sqlType;
        int precision;
        int scale;
    }

    /**
     * A simple array implementation,
     * backed by an object array
     */
    private static class SimpleArray implements Array {
        
        private Object[] value;
        
        private SimpleArray(Object[] value) {
            this.value = value;
        }

        /**
         * Get the object array.
         * 
         * @return the object array
         */
        public Object getArray() throws SQLException {
            return value;
        }

        /**
         * INTERNAL 
         */
        public Object getArray(Map map) throws SQLException {
            throw getUnsupportedException();
        }

        /**
         * INTERNAL 
         */
        public Object getArray(long index, int count) throws SQLException {
            throw getUnsupportedException();
        }

        /**
         * INTERNAL 
         */
        public Object getArray(long index, int count, Map map) throws SQLException {
            throw getUnsupportedException();
        }

        /**
         * Get the base type of this array.
         * 
         * @return Types.NULL
         */
        public int getBaseType() throws SQLException {
            return Types.NULL;
        }

        /**
         * Get the base type name of this array.
         * 
         * @return "NULL"
         */
        public String getBaseTypeName() throws SQLException {
            return "NULL";
        }

        /**
         * INTERNAL 
         */
        public ResultSet getResultSet() throws SQLException {
            throw getUnsupportedException();
        }

        /**
         * INTERNAL 
         */
        public ResultSet getResultSet(Map map) throws SQLException {
            throw getUnsupportedException();
        }

        /**
         * INTERNAL 
         */
        public ResultSet getResultSet(long index, int count) throws SQLException {
            throw getUnsupportedException();
        }

        /**
         * INTERNAL 
         */
        public ResultSet getResultSet(long index, int count, Map map) throws SQLException {
            throw getUnsupportedException();
        }

        /**
         * INTERNAL 
         */
        public void free() throws SQLException {
        }

    }

    /**
     * This constructor is used if the result set is later populated with addRow.
     */
    public SimpleResultSet() {
        rows = new ArrayList();
    }

    /**
     * This constructor is used if the result set should retrieve the rows using
     * the specified row source object.
     * 
     * @param source the row source
     */
    public SimpleResultSet(SimpleRowSource source) {
        this.source = source;
    }

    /**
     * Adds a column to the result set.
     *
     * @param name null is replaced with C1, C2,...
     * @param sqlType the value returned in getColumnType(..) (ignored internally)
     * @param precision the precision
     * @param scale the scale
     * @throws SQLException
     */
    public void addColumn(String name, int sqlType, int precision, int scale) throws SQLException {
        if (rows != null && rows.size() > 0) {
            throw new SQLException("Cannot add a column after adding rows", "21S02");
        }
        if (name == null) {
            name = "C" + (columns.size() + 1);
        }
        Column column = new Column();
        column.name = name;
        column.sqlType = sqlType;
        column.precision = precision;
        column.scale = scale;
        columns.add(column);
    }

    /**
     * Add a new row to the result set.
     *
     * @param row the row as an array of objects
     */
    public void addRow(Object[] row) throws SQLException {
        if (rows == null) {
            throw new SQLException("Cannot add a row when using RowSource", "21S02");
        }
        rows.add(row);
    }

    /**
     * Returns ResultSet.CONCUR_READ_ONLY.
     *
     * @return CONCUR_READ_ONLY
     */
    public int getConcurrency() throws SQLException {
        return ResultSet.CONCUR_READ_ONLY;
    }

    /**
     * Returns ResultSet.FETCH_FORWARD.
     *
     * @return FETCH_FORWARD
     */
    public int getFetchDirection() throws SQLException {
        return ResultSet.FETCH_FORWARD;
    }

    /**
     * Returns 0.
     *
     * @return 0
     */
    public int getFetchSize() throws SQLException {
        return 0;
    }

    /**
     * Returns the row number (1, 2,...) or 0 for no row.
     *
     * @return 0
     */
    public int getRow() throws SQLException {
        return rowId + 1;
    }

    /**
     * Returns ResultSet.TYPE_FORWARD_ONLY.
     *
     * @return TYPE_FORWARD_ONLY
     */
    public int getType() throws SQLException {
        return ResultSet.TYPE_FORWARD_ONLY;
    }

    /**
     * Closes the result set and releases the resources.
     */
    public void close() throws SQLException {
        currentRow = null;
        rows = null;
        columns = null;
        rowId = -1;
        if (source != null) {
            source.close();
            source = null;
        }
    }

    /**
     * Moves the cursor to the next row of the result set.
     *
     * @return true if successful, false if there are no more rows
     */
    public boolean next() throws SQLException {
        if (source != null) {
            rowId++;
            currentRow = source.readRow();
            if (currentRow != null) {
                return true;
            }
        } else if (rows != null && rowId < rows.size()) {
            rowId++;
            if (rowId < rows.size()) {
                currentRow = (Object[]) rows.get(rowId);
                return true;
            }
        }
        close();
        return false;
    }

    /**
     * Moves the current position to before the first row, that means resets the
     * result set.
     * 
     * @throws SQLException is this method is not supported
     */
    public void beforeFirst() throws SQLException {
        rowId = -1;
        if (source != null) {
            source.reset();
        }
    }

    /**
     * Returns whether the last column accessed was null.
     *
     * @return true if the last column accessed was null
     */
    public boolean wasNull() throws SQLException {
        return wasNull;
    }

    /**
     * Returns the value as a byte.
     *
     * @return the value
     */
    public byte getByte(int columnIndex) throws SQLException {
        Object o = get(columnIndex);
        if (o != null && !(o instanceof Number)) {
            o = Byte.decode(o.toString());
        }
        return o == null ? 0 : ((Number) o).byteValue();
    }

    /**
     * Returns the value as an double.
     *
     * @return the value
     */
    public double getDouble(int columnIndex) throws SQLException {
        Object o = get(columnIndex);
        if (o != null && !(o instanceof Number)) {
            return Double.parseDouble(o.toString());
        }
        return o == null ? 0 : ((Number) o).doubleValue();
    }

    /**
     * Returns the value as a float.
     *
     * @return the value
     */
    public float getFloat(int columnIndex) throws SQLException {
        Object o = get(columnIndex);
        if (o != null && !(o instanceof Number)) {
            return Float.parseFloat(o.toString());
        }
        return o == null ? 0 : ((Number) o).floatValue();
    }

    /**
     * Returns the value as an int.
     *
     * @return the value
     */
    public int getInt(int columnIndex) throws SQLException {
        Object o = get(columnIndex);
        if (o != null && !(o instanceof Number)) {
            o = Integer.decode(o.toString());
        }
        return o == null ? 0 : ((Number) o).intValue();
    }

    /**
     * Returns the value as a long.
     *
     * @return the value
     */
    public long getLong(int columnIndex) throws SQLException {
        Object o = get(columnIndex);
        if (o != null && !(o instanceof Number)) {
            o = Long.decode(o.toString());
        }
        return o == null ? 0 : ((Number) o).longValue();
    }

    /**
     * Returns the value as a short.
     *
     * @return the value
     */
    public short getShort(int columnIndex) throws SQLException {
        Object o = get(columnIndex);
        if (o != null && !(o instanceof Number)) {
            o = Short.decode(o.toString());
        }
        return o == null ? 0 : ((Number) o).shortValue();
    }

    /**
     * Returns the value as a boolean.
     *
     * @return the value
     */
    public boolean getBoolean(int columnIndex) throws SQLException {
        Object o = get(columnIndex);
        if (o != null && !(o instanceof Boolean)) {
            o = Boolean.valueOf(o.toString());
        }
        return o == null ? false : ((Boolean) o).booleanValue();
    }

    /**
     * Returns the value as a byte array.
     *
     * @return the value
     */
    public byte[] getBytes(int columnIndex) throws SQLException {
        return (byte[]) get(columnIndex);
    }

    /**
     * Returns the value as an Object.
     *
     * @return the value
     */
    public Object getObject(int columnIndex) throws SQLException {
        return get(columnIndex);
    }

    /**
     * Returns the value as a String.
     *
     * @return the value
     */
    public String getString(int columnIndex) throws SQLException {
        Object o = get(columnIndex);
        return o == null ? null : o.toString();
    }

    /**
     * Returns the value as a byte.
     *
     * @return the value
     */
    public byte getByte(String columnName) throws SQLException {
        return getByte(findColumn(columnName));
    }

    /**
     * Returns the value as a double.
     *
     * @return the value
     */
    public double getDouble(String columnName) throws SQLException {
        return getDouble(findColumn(columnName));
    }

    /**
     * Returns the value as a float.
     *
     * @return the value
     */
    public float getFloat(String columnName) throws SQLException {
        return getFloat(findColumn(columnName));
    }

    /**
     * Searches for a specific column in the result set. A case-insensitive
     * search is made.
     * 
     * @param columnName the name of the column label
     * @return the column index (1,2,...)
     * @throws SQLException if the column is not found or if the result set is
     *             closed
     */
    public int findColumn(String columnName) throws SQLException {
        for (int i = 0; columnName != null && columns != null && i < columns.size(); i++) {
            if (columnName.equalsIgnoreCase(getColumn(i).name)) {
                return i + 1;
            }
        }
        throw new SQLException("Column not found: " + columnName, "42S22");
    }

    /**
     * Returns the value as an int.
     *
     * @return the value
     */
    public int getInt(String columnName) throws SQLException {
        return getInt(findColumn(columnName));
    }

    /**
     * Returns the value as a long.
     *

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久麻豆一区二区| 亚洲欧美日韩电影| 91视频一区二区三区| 午夜a成v人精品| 国产精品国产三级国产a| 日韩一二三区不卡| 91色porny蝌蚪| 国产福利不卡视频| 蜜臂av日日欢夜夜爽一区| 亚洲男人的天堂在线aⅴ视频| 久久夜色精品一区| 91精品一区二区三区在线观看| 99久久国产免费看| 国产激情一区二区三区桃花岛亚洲| 亚洲v日本v欧美v久久精品| 国产精品美女久久久久aⅴ| 日韩精品一区二| 911精品国产一区二区在线| 色噜噜狠狠色综合中国| 盗摄精品av一区二区三区| 久久不见久久见免费视频7| 亚洲国产精品久久久久秋霞影院 | 在线观看视频一区| 懂色av中文一区二区三区| 国产精品资源在线看| 另类小说视频一区二区| 日本成人在线一区| 午夜欧美在线一二页| 亚洲一区二区精品3399| 亚洲老妇xxxxxx| 亚洲免费高清视频在线| 亚洲色欲色欲www| 自拍偷拍亚洲综合| 国产精品女人毛片| 国产精品久久久久久久久果冻传媒| 久久久久免费观看| 久久久精品欧美丰满| 久久嫩草精品久久久久| 久久毛片高清国产| 久久久不卡网国产精品一区| www精品美女久久久tv| 欧美成人video| 久久久久青草大香线综合精品| 精品国产伦一区二区三区观看方式| 91精品国产乱| 精品久久久久久久一区二区蜜臀| 欧美xfplay| 久久精品免费在线观看| 日本一区二区三区dvd视频在线| 久久久精品2019中文字幕之3| 国产欧美一区二区三区在线看蜜臀 | 丝袜亚洲另类欧美| 日本不卡高清视频| 精品一区二区三区免费毛片爱| 麻豆精品蜜桃视频网站| 国产一区二区免费视频| 成人av网站免费| 欧洲精品在线观看| 91精品在线一区二区| 欧美xxxxxxxx| 国产精品久久久久久久久晋中| 亚洲免费观看高清完整版在线观看| 亚洲国产日韩精品| 免费观看成人鲁鲁鲁鲁鲁视频| 国产伦精品一区二区三区免费| 成人福利电影精品一区二区在线观看| 91免费观看国产| 欧美日精品一区视频| 日韩欧美三级在线| 中文欧美字幕免费| 亚洲一区二区三区影院| 久久99精品久久久久久久久久久久| 国产.欧美.日韩| 欧美日韩在线直播| 久久久久久久综合狠狠综合| 日韩理论片一区二区| 日韩电影免费一区| 不卡免费追剧大全电视剧网站| 欧美性受极品xxxx喷水| 精品三级在线观看| 亚洲日本在线a| 麻豆91精品视频| 97se亚洲国产综合在线| 在线成人av网站| 国产精品久久777777| 日韩精品乱码av一区二区| 成人综合在线视频| 91麻豆精品国产91久久久久久久久| 欧美精彩视频一区二区三区| 丝袜a∨在线一区二区三区不卡| 国产成人久久精品77777最新版本| 欧美亚洲精品一区| 中文字幕乱码久久午夜不卡 | 欧美成人性福生活免费看| 亚洲精选视频在线| 国产在线乱码一区二区三区| 在线欧美日韩国产| 国产午夜亚洲精品午夜鲁丝片| 亚洲国产成人精品视频| www.欧美.com| 久久人人97超碰com| 性感美女极品91精品| 99精品视频在线免费观看| 久久久高清一区二区三区| 日韩精品五月天| 欧美性大战久久| 中文字幕欧美一区| 国产高清精品在线| 精品国产污污免费网站入口| 手机精品视频在线观看| 欧美无乱码久久久免费午夜一区 | 麻豆精品一区二区| 欧美亚洲综合网| 亚洲裸体xxx| www.亚洲激情.com| 日本一区二区三区四区| 国产真实乱子伦精品视频| 欧美一区二区三区在线观看| 亚洲午夜视频在线观看| 色美美综合视频| 亚洲乱码国产乱码精品精小说| 成人福利视频在线看| 国产日韩欧美综合一区| 国产九色sp调教91| 久久精品一区四区| 国产福利精品一区二区| 国产亚洲精品aa午夜观看| 国产在线精品一区二区| 日韩欧美国产综合| 麻豆91免费看| 欧美精品一区二区三区蜜桃 | 久久精品国产第一区二区三区| 91精品国产欧美一区二区18| 视频在线在亚洲| 欧美一区二区精美| 麻豆91在线看| 久久久久久久久久美女| 国产一区二区三区精品视频| 久久久久久电影| 国产成+人+日韩+欧美+亚洲| 中文字幕免费不卡| 97国产一区二区| 亚洲精品伦理在线| 欧美日本一区二区三区四区| 午夜影院在线观看欧美| 7777精品伊人久久久大香线蕉 | 欧美精品久久久久久久多人混战 | 国产精品毛片久久久久久| 成人va在线观看| 亚洲男同1069视频| 欧美日韩国产另类一区| 免费精品视频在线| 久久久久久久久97黄色工厂| 成人免费看黄yyy456| 亚洲视频一区在线观看| 欧美日韩国产不卡| 精品亚洲国产成人av制服丝袜 | 久久精品一二三| 成人av在线一区二区| 亚洲已满18点击进入久久| 日韩一区二区在线观看视频| 国产高清成人在线| 亚洲精品国产第一综合99久久| 91精品欧美福利在线观看| 国产乱妇无码大片在线观看| 亚洲精品美国一| 日韩欧美成人激情| 99视频精品全部免费在线| 午夜精品久久久久久久99水蜜桃| 精品国产一区二区亚洲人成毛片| 成人一二三区视频| 天天亚洲美女在线视频| 国产三级精品三级| 欧美日韩在线播放一区| 国产精品一区在线| 一区二区三区加勒比av| 日韩一级黄色片| 色偷偷88欧美精品久久久| 蜜桃免费网站一区二区三区| 国产精品不卡在线| 日韩一级视频免费观看在线| 99久久伊人精品| 久久超碰97中文字幕| 夜夜嗨av一区二区三区网页| 精品黑人一区二区三区久久| 欧洲一区二区三区免费视频| 国产精品一区二区三区99| 亚洲电影第三页| 中文字幕一区在线| 日韩美一区二区三区| 欧美在线999| 东方aⅴ免费观看久久av| 日韩国产一区二| 综合久久综合久久| 国产亚洲欧美激情| 日韩欧美中文字幕制服| 欧美在线视频日韩| 9人人澡人人爽人人精品| 免费成人av资源网| 亚洲高清在线精品|