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

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

?? table.java

?? Java寫的含有一個(gè)jdbc驅(qū)動(dòng)的小型數(shù)據(jù)庫數(shù)據(jù)庫引擎
?? JAVA
?? 第 1 頁 / 共 2 頁
字號(hào):
/*
 * Table.java
 *
 * Copyright (c) 2001, The HSQL Development Group
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice, this
 * list of conditions and the following disclaimer.
 *
 * 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.
 *
 *
 * Neither the name of the HSQL Development Group nor the names of its
 * contributors may be used to endorse or promote products derived from this
 * software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS 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 THE REGENTS OR 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.
 *
 * This package is based on HypersonicSQL, originally developed by Thomas Mueller.
 *
 */
package org.hsqldb;

import java.sql.SQLException;
import java.util.Vector;

/**
 * Class declaration
 *
 *
 * @version 1.0.0.1
 */
class Table {
    private String   sName;
    private Vector   vColumn;
    private Vector   vIndex;		 // vIndex(0) is always the primary key index
    private int      iVisibleColumns;    // table may contain a hidden primary key
    private int      iColumnCount;    // inclusive the (maybe hidden) primary key
    private int      iPrimaryKey;
    private boolean  bCached;
    private Database dDatabase;
    private Log      lLog;
    private int      iIndexCount;
    private int      iIdentityColumn;    // -1 means no such row
    private int      iIdentityId;
    private Vector   vConstraint;
    private int      iConstraintCount;
    Cache	     cCache;
    Vector	     vTrigs[];

    /**
     * Constructor declaration
     *
     *
     * @param db
     * @param log
     * @param name
     * @param cached
     */
    Table(Database db, boolean log, String name, boolean cached) {
	dDatabase = db;
	lLog = log ? db.getLog() : null;

	if (cached) {
	    cCache = lLog.cCache;
	    bCached = true;
	}

	sName = name;
	iPrimaryKey = -1;
	iIdentityColumn = -1;
	vColumn = new Vector();
	vIndex = new Vector();
	vConstraint = new Vector();
	vTrigs = new Vector[TriggerDef.numTrigs()];

	for (int vi = 0; vi < TriggerDef.numTrigs(); vi++) {
	    vTrigs[vi] = new Vector();
	}
    }

    /**
     * Method declaration
     *
     *
     * @param c
     */
    void addConstraint(Constraint c) {
	vConstraint.addElement(c);

	iConstraintCount++;
    }

    /**
     * Method declaration
     *
     *
     * @return
     */
    Vector getConstraints() {
	return vConstraint;
    }

    /**
     * Method declaration
     *
     *
     * @param name
     * @param type
     *
     * @throws SQLException
     */
    void addColumn(String name, int type) throws SQLException {
	addColumn(name, type, true, false);
    }

    /**
     * Method declaration
     *
     *
     * @param c
     *
     * @throws SQLException
     */
    void addColumn(Column c) throws SQLException {
	addColumn(c.sName, c.iType, c.isNullable(), c.isIdentity());
    }

    /**
     * Method declaration
     *
     *
     * @param name
     * @param type
     * @param nullable
     * @param identity
     *
     * @throws SQLException
     */
    void addColumn(String name, int type, boolean nullable,
		   boolean identity) throws SQLException {
	if (identity) {
	    Trace.check(type == Column.INTEGER, Trace.WRONG_DATA_TYPE, name);
	    Trace.check(iIdentityColumn == -1, Trace.SECOND_PRIMARY_KEY,
			name);

	    iIdentityColumn = iColumnCount;
	}

	Trace.assert(iPrimaryKey == -1, "Table.addColumn");
	vColumn.addElement(new Column(name, nullable, type, identity));

	iColumnCount++;
    }

    /**
     * Method declaration
     *
     *
     * @param result
     *
     * @throws SQLException
     */
    void addColumns(Result result) throws SQLException {
	for (int i = 0; i < result.getColumnCount(); i++) {
	    addColumn(result.sLabel[i], result.iType[i], true, false);
	}
    }

    /**
     * Method declaration
     *
     *
     * @return
     */
    String getName() {
	return sName;
    }

    /**
     * Method declaration
     *
     *
     * @return
     */
    int getInternalColumnCount() {

	// todo: this is a temporary solution;
	// the the hidden column is not really required
	return iColumnCount;
    }

    /**
     * Method declaration
     *
     *
     * @param withoutindex
     *
     * @return
     *
     * @throws SQLException
     */
    Table moveDefinition(String withoutindex) throws SQLException {
	Table tn = new Table(dDatabase, true, getName(), isCached());

	for (int i = 0; i < getColumnCount(); i++) {
	    tn.addColumn(getColumn(i));
	}

	// todo: there should be nothing special with the primary key!
	if (iVisibleColumns < iColumnCount) {
	    tn.createPrimaryKey();
	} else {
	    tn.createPrimaryKey(getPrimaryIndex().getColumns()[0]);
	}

	Index idx = null;

	while (true) {
	    idx = getNextIndex(idx);

	    if (idx == null) {
		break;
	    }

	    if (withoutindex != null && idx.getName().equals(withoutindex)) {
		continue;
	    }

	    if (idx == getPrimaryIndex()) {
		continue;
	    }

	    tn.createIndex(idx);
	}

	for (int i = 0; i < iConstraintCount; i++) {
	    Constraint c = (Constraint) vConstraint.elementAt(i);

	    c.replaceTable(this, tn);
	}

	tn.vConstraint = vConstraint;

	return tn;
    }

    /**
     * Method declaration
     *
     *
     * @return
     */
    int getColumnCount() {
	return iVisibleColumns;
    }

    /**
     * Method declaration
     *
     *
     * @return
     */
    int getIndexCount() {
	return iIndexCount;
    }

    /**
     * Method declaration
     *
     *
     * @return
     */
    int getIdentityColumn() {
	return iIdentityColumn;
    }

    /**
     * Method declaration
     *
     *
     * @param c
     *
     * @return
     *
     * @throws SQLException
     */
    int getColumnNr(String c) throws SQLException {
	int i = searchColumn(c);

	if (i == -1) {
	    throw Trace.error(Trace.COLUMN_NOT_FOUND, c);
	}

	return i;
    }

    /**
     * Method declaration
     *
     *
     * @param c
     *
     * @return
     */
    int searchColumn(String c) {
	for (int i = 0; i < iColumnCount; i++) {
	    if (c.equals(((Column) vColumn.elementAt(i)).sName)) {
		return i;
	    }
	}

	return -1;
    }

    /**
     * Method declaration
     *
     *
     * @param i
     *
     * @return
     */
    String getColumnName(int i) {
	return getColumn(i).sName;
    }

    /**
     * Method declaration
     *
     *
     * @param i
     *
     * @return
     */
    int getColumnType(int i) {
	return getColumn(i).iType;
    }

    /**
     * Method declaration
     *
     *
     * @param i
     *
     * @return
     */
    boolean getColumnIsNullable(int i) {
	return getColumn(i).isNullable();
    }

    /**
     * Method declaration
     *
     *
     * @return
     *
     * @throws SQLException
     */
    Index getPrimaryIndex() throws SQLException {
	if (iPrimaryKey == -1) {
	    return null;
	}

	return getIndex(0);
    }

    /**
     * Method declaration
     *
     *
     * @param column
     *
     * @return
     *
     * @throws SQLException
     */
    Index getIndexForColumn(int column) throws SQLException {
	for (int i = 0; i < iIndexCount; i++) {
	    Index h = getIndex(i);

	    if (h.getColumns()[0] == column) {
		return h;
	    }
	}

	return null;
    }

    /**
     * Method declaration
     *
     *
     * @param col
     *
     * @return
     *
     * @throws SQLException
     */
    Index getIndexForColumns(int col[]) throws SQLException {
	for (int i = 0; i < iIndexCount; i++) {
	    Index h = getIndex(i);
	    int   icol[] = h.getColumns();
	    int   j = 0;

	    for (; j < col.length; j++) {
		if (j >= icol.length) {
		    break;
		}

		if (icol[j] != col[j]) {
		    break;
		}
	    }

	    if (j == col.length) {
		return h;
	    }
	}

	return null;
    }

    /**
     * Method declaration
     *
     *
     * @return
     *
     * @throws SQLException
     */
    String getIndexRoots() throws SQLException {
	Trace.assert(bCached, "Table.getIndexRootData");

	String s = "";

	for (int i = 0; i < iIndexCount; i++) {
	    Node f = getIndex(i).getRoot();

	    if (f != null) {
		s = s + f.getKey() + " ";
	    } else {
		s = s + "-1 ";
	    }
	}

	s += iIdentityId;

	return s;
    }

    /**
     * Method declaration
     *
     *
     * @param s
     *
     * @throws SQLException
     */
    void setIndexRoots(String s) throws SQLException {

	// the user may try to set this; this is not only internal problem
	Trace.check(bCached, Trace.TABLE_NOT_FOUND);

	int j = 0;

	for (int i = 0; i < iIndexCount; i++) {
	    int n = s.indexOf(' ', j);
	    int p = Integer.parseInt(s.substring(j, n));

	    if (p != -1) {
		Row  r = cCache.getRow(p, this);
		Node f = r.getNode(i);

		getIndex(i).setRoot(f);
	    }

	    j = n + 1;
	}

	iIdentityId = Integer.parseInt(s.substring(j));
    }

    /**
     * Method declaration
     *
     *
     * @param index
     *
     * @return
     */
    Index getNextIndex(Index index) {
	int i = 0;

	if (index != null) {
	    for (; i < iIndexCount && getIndex(i) != index; i++);

	    i++;
	}

	if (i < iIndexCount) {
	    return getIndex(i);
	}

	return null;    // no more indexes
    }

    /**
     * Method declaration
     *
     *
     * @param i
     *
     * @return
     */
    int getType(int i) {
	return getColumn(i).iType;
    }

    /**
     * Method declaration
     *
     *
     * @param column
     *
     * @throws SQLException
     */
    void createPrimaryKey(int column) throws SQLException {
	Trace.assert(iPrimaryKey == -1, "Table.createPrimaryKey(column)");

	iVisibleColumns = iColumnCount;
	iPrimaryKey = column;

	int col[] = {
	    column

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲国产精品久久一线不卡| 国产精品久久久久久一区二区三区 | 视频在线观看国产精品| 久久久久久综合| 欧美日韩精品高清| 91丨九色porny丨蝌蚪| 国产真实乱子伦精品视频| 亚洲无人区一区| 国产精品免费久久| 日韩精品一区二区三区在线播放| 91久久精品一区二区三区| 国产福利91精品一区二区三区| 天堂蜜桃91精品| 伊人开心综合网| 国产精品美女久久久久久久久久久| 7777精品伊人久久久大香线蕉完整版| 91污片在线观看| 成人性生交大合| 捆绑紧缚一区二区三区视频| 一片黄亚洲嫩模| 一区二区中文视频| 中文字幕欧美日韩一区| 久久综合九色综合97婷婷女人| 欧美巨大另类极品videosbest| 91福利在线导航| 99v久久综合狠狠综合久久| 懂色av中文一区二区三区| 精品一区二区三区在线视频| 日本成人中文字幕| 日本女人一区二区三区| 五月激情综合婷婷| 亚洲高清免费观看| 亚洲尤物视频在线| 亚洲国产综合91精品麻豆| 亚洲自拍偷拍网站| 亚洲永久精品国产| 亚洲国产三级在线| 亚洲1区2区3区4区| 日日夜夜精品视频免费| 日韩avvvv在线播放| 亚洲国产精品久久艾草纯爱 | 亚洲激情男女视频| 亚洲另类一区二区| 亚洲综合小说图片| 亚洲gay无套男同| 日本欧美一区二区三区乱码| 奇米四色…亚洲| 九九国产精品视频| 国产91在线观看| 欧美高清激情brazzers| 欧美挠脚心视频网站| 欧美精品v日韩精品v韩国精品v| 欧美男生操女生| 欧美tickling挠脚心丨vk| 久久午夜电影网| 国产精品高潮呻吟久久| 玉足女爽爽91| 午夜激情一区二区三区| 精品在线亚洲视频| 国产99精品国产| 91黄色小视频| 欧美一区二区播放| 国产亚洲欧洲997久久综合 | 亚洲一区免费视频| 天天影视涩香欲综合网| 精品系列免费在线观看| 丁香五精品蜜臀久久久久99网站| 91女厕偷拍女厕偷拍高清| 欧美色综合影院| 欧美不卡123| 亚洲三级视频在线观看| 日韩福利视频导航| 国产高清亚洲一区| 欧美午夜一区二区| 久久久久久一级片| 亚洲最大的成人av| 国产资源精品在线观看| 色婷婷精品久久二区二区蜜臂av | 九九国产精品视频| 99re热视频精品| 欧美一区二区视频免费观看| 中文字幕免费不卡| 午夜久久久影院| 国产成人免费在线观看不卡| 欧美视频中文一区二区三区在线观看| 日韩欧美一二三区| 亚洲另类在线制服丝袜| 国内久久精品视频| 欧美视频你懂的| 中文无字幕一区二区三区| 丝袜美腿亚洲一区二区图片| 国产美女精品一区二区三区| 91视频在线观看| 精品电影一区二区| 亚洲bdsm女犯bdsm网站| jvid福利写真一区二区三区| 日韩一区二区三区精品视频| 成人欧美一区二区三区黑人麻豆 | 色婷婷激情综合| 夜夜操天天操亚洲| 久久66热re国产| 欧美色视频一区| 国产精品美女久久久久av爽李琼 | 精品国产一区二区三区四区四 | 一区二区三区在线免费| 国产麻豆视频一区| 337p亚洲精品色噜噜噜| 亚洲欧美电影院| 国产suv精品一区二区883| 欧美一级免费观看| 亚洲国产综合人成综合网站| 成人av高清在线| 久久久久久久免费视频了| 日本不卡免费在线视频| 在线观看www91| 国产精品伦理一区二区| 国产精品小仙女| 日韩精品一区二区三区在线 | 蜜桃av噜噜一区| 欧美绝品在线观看成人午夜影视| 亚洲人吸女人奶水| 成人国产精品免费观看| 久久精品水蜜桃av综合天堂| 久久国产精品色| 日韩一本二本av| 日韩国产欧美在线视频| 欧美喷潮久久久xxxxx| 亚欧色一区w666天堂| 欧美视频一区二区三区四区| 一区二区三区电影在线播| aaa亚洲精品一二三区| 国产精品美女久久久久久久久| 懂色av噜噜一区二区三区av| 久久奇米777| 国产精品一二三四五| 国产亚洲精品7777| 国产精品一区二区久激情瑜伽| 久久美女艺术照精彩视频福利播放| 久久精品av麻豆的观看方式| 精品欧美黑人一区二区三区| 极品少妇一区二区三区精品视频 | 成人av在线资源| 国产精品乱码一区二区三区软件 | 欧美一区二区在线播放| 爽好多水快深点欧美视频| 7777精品伊人久久久大香线蕉经典版下载 | 国产一区二区三区免费播放| 欧美精品一区二区三区视频| 国产在线麻豆精品观看| 久久久不卡影院| 欧美一区二区三区免费在线看 | 成人av资源站| 亚洲免费观看高清完整版在线观看熊| 91黄色免费观看| 亚洲国产精品自拍| 欧美精品一二三| 久久99精品一区二区三区| 国产欧美日韩在线观看| 不卡的av在线| 亚洲一卡二卡三卡四卡| 日韩小视频在线观看专区| 国产精品中文字幕欧美| 1024精品合集| 777奇米成人网| 国产精品18久久久久久vr| 日韩理论电影院| 欧美一区二区三区四区五区 | 欧美精品一区二区蜜臀亚洲| 懂色av一区二区夜夜嗨| 亚洲专区一二三| 欧美成人一区二区三区片免费 | 这里只有精品免费| 国产精品69毛片高清亚洲| 亚洲裸体xxx| 日韩免费视频线观看| 99热在这里有精品免费| 性欧美大战久久久久久久久| 久久精品亚洲精品国产欧美 | 五月天国产精品| 久久婷婷国产综合精品青草 | 色综合夜色一区| 日本亚洲视频在线| 国产精品久线在线观看| 欧美丰满少妇xxxxx高潮对白| 国产成人精品三级麻豆| 亚洲一二三四区不卡| 日本一区二区免费在线| 欧美麻豆精品久久久久久| 成人午夜av电影| 日韩和欧美的一区| 最好看的中文字幕久久| 欧美刺激午夜性久久久久久久| 91一区一区三区| 激情小说欧美图片| 亚洲一区二区三区中文字幕| 国产人妖乱国产精品人妖| 6080亚洲精品一区二区| av不卡免费在线观看| 国产在线麻豆精品观看| 日韩av高清在线观看|