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

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

?? simpleresultset.java

?? 非常棒的java數據庫
?? JAVA
?? 第 1 頁 / 共 4 頁
字號:
/*
 * 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.
     *

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美三级视频在线播放| 久久婷婷久久一区二区三区| 91麻豆精品国产91久久久| 久久蜜桃av一区二区天堂| 一个色妞综合视频在线观看| 黑人巨大精品欧美一区| 色婷婷久久久综合中文字幕| 2020国产精品| 三级欧美在线一区| 91免费在线视频观看| 国产午夜亚洲精品羞羞网站| 免费精品99久久国产综合精品| 色久综合一二码| 国产午夜亚洲精品午夜鲁丝片| 日本不卡一区二区| 欧美无砖专区一中文字| 亚洲少妇最新在线视频| 国产精品一区不卡| 精品电影一区二区三区| 蜜臀国产一区二区三区在线播放| 一本到三区不卡视频| 综合激情成人伊人| 99视频精品在线| 中文字幕一区二区视频| 成人激情黄色小说| 国产日产欧美一区二区视频| 韩国视频一区二区| 2014亚洲片线观看视频免费| 九色综合国产一区二区三区| 日韩一区二区在线看| 免费欧美在线视频| 日韩视频免费直播| 麻豆一区二区三区| 欧美刺激午夜性久久久久久久| 日韩精品久久久久久| 欧美精品乱人伦久久久久久| 三级在线观看一区二区| 欧美一级日韩免费不卡| 麻豆精品在线看| 337p粉嫩大胆色噜噜噜噜亚洲| 精品一区二区久久| 久久久久国产精品人| 高清av一区二区| 亚洲视频小说图片| 色94色欧美sute亚洲13| 午夜久久久久久久久| 日韩一区二区精品葵司在线| 狠狠色丁香婷综合久久| 国产精品女主播在线观看| 91亚洲国产成人精品一区二区三| 亚洲摸摸操操av| 欧美高清性hdvideosex| 久久精品国产亚洲一区二区三区| 成人免费一区二区三区视频 | 麻豆91在线观看| 欧美tickle裸体挠脚心vk| 国产在线精品一区二区三区不卡| 国产丝袜美腿一区二区三区| 97se亚洲国产综合自在线| 亚洲精品国产a| 欧美一卡2卡3卡4卡| 国产一区二区三区蝌蚪| 中文字幕制服丝袜一区二区三区| 欧美综合在线视频| 国模冰冰炮一区二区| 国产欧美精品一区二区色综合朱莉| 成人97人人超碰人人99| 偷拍日韩校园综合在线| 精品国产3级a| 91国模大尺度私拍在线视频| 奇米亚洲午夜久久精品| 国产精品嫩草影院av蜜臀| 欧美日韩一区二区三区高清| 国产在线一区二区综合免费视频| 成人免费在线播放视频| 日韩视频一区在线观看| 91在线小视频| 韩国女主播一区二区三区| 亚洲精品日日夜夜| 精品入口麻豆88视频| 色婷婷久久久亚洲一区二区三区| 麻豆视频一区二区| 亚洲综合清纯丝袜自拍| 久久伊人蜜桃av一区二区| 欧美在线制服丝袜| 国产成人在线视频免费播放| 亚洲成av人影院在线观看网| 国产嫩草影院久久久久| 91精品国产综合久久小美女| av男人天堂一区| 韩日av一区二区| 午夜电影一区二区三区| 中文字幕亚洲欧美在线不卡| 日韩欧美国产电影| 欧美日韩国产a| 色综合久久中文综合久久牛| 精品亚洲免费视频| 日本系列欧美系列| 午夜不卡av在线| 亚洲激情成人在线| 国产精品色在线观看| 久久久蜜桃精品| 日韩精品在线看片z| 这里只有精品免费| 欧美欧美欧美欧美首页| 欧美性色欧美a在线播放| 99精品视频一区| 粉嫩一区二区三区在线看| 激情综合网av| 麻豆91在线看| 国内外精品视频| 九一九一国产精品| 久久69国产一区二区蜜臀| 久久电影网站中文字幕| 毛片不卡一区二区| 韩国女主播一区二区三区| 精品一区二区影视| 国产在线精品视频| 国产一区二区福利| 国产精品2024| 成人黄色一级视频| 成人视屏免费看| k8久久久一区二区三区| 一本色道**综合亚洲精品蜜桃冫 | 国产日本亚洲高清| 欧美经典三级视频一区二区三区| 欧美激情一区二区三区不卡| 国产精品天干天干在观线| 一区精品在线播放| 伊人色综合久久天天| 亚洲mv在线观看| 男男gaygay亚洲| 国产高清成人在线| 99国产精品视频免费观看| 91蝌蚪porny成人天涯| 欧美视频中文字幕| 欧美成人官网二区| 国产日韩欧美激情| 亚洲免费看黄网站| 亚洲一区二区视频| 美女精品一区二区| 丁香天五香天堂综合| 色香蕉成人二区免费| 欧美乱熟臀69xxxxxx| 久久久综合激的五月天| 中文字幕一区二区三区在线观看 | 欧美日韩中字一区| 日韩一区二区在线播放| 久久久久久久免费视频了| 亚洲人妖av一区二区| 日韩专区在线视频| 成人丝袜18视频在线观看| 精品视频123区在线观看| 亚洲精品一区二区三区在线观看| 国产精品久久久久久久久快鸭| 亚洲一区二区三区激情| 韩日精品视频一区| 日本韩国一区二区| 久久亚洲春色中文字幕久久久| 亚洲摸摸操操av| 国产中文一区二区三区| 91国偷自产一区二区使用方法| 精品久久久久久久久久久久久久久久久| 国产精品色婷婷| 免费久久99精品国产| 色婷婷av一区二区三区大白胸| 精品国精品国产| 午夜欧美视频在线观看| 丰满白嫩尤物一区二区| 日韩精品一区二区三区在线| 亚洲精品日产精品乱码不卡| 国产一区二区三区免费观看| 欧美日韩国产一级二级| 国产精品国产三级国产aⅴ中文 | 成人爱爱电影网址| 91精品国产一区二区三区香蕉| 亚洲天堂av老司机| 国产一区二区精品在线观看| 91精品国产乱| 亚洲综合免费观看高清在线观看| 国产999精品久久久久久绿帽| 欧美电影免费观看完整版| 亚洲国产精品久久人人爱蜜臀| 不卡一区在线观看| 精品动漫一区二区三区在线观看| 日本女人一区二区三区| 一本大道av伊人久久综合| 国产精品欧美一区二区三区| 韩国成人精品a∨在线观看| 日韩天堂在线观看| 青青青爽久久午夜综合久久午夜| 欧美午夜精品免费| 亚洲一区在线观看免费| 91麻豆福利精品推荐| 亚洲男女一区二区三区| 色综合久久中文字幕综合网| 亚洲欧美韩国综合色| 91在线观看高清| 一区二区免费视频| 欧美主播一区二区三区|