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

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

?? h2adapter.java.txt

?? 非常棒的java數據庫
?? TXT
字號:
/**********************************************************************
Copyright (c) 2006 Andy Jefferson and others. All rights reserved.
Licensed 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.

Contributors:
2006 Thomas Mueller - updated the dialect for the H2 database engine
**********************************************************************/
package org.jpox.store.rdbms.adapter;

import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;

import javax.sql.DataSource;

import org.jpox.store.DatastoreContainerObject;
import org.jpox.store.DatastoreIdentifier;
import org.jpox.store.Dictionary;
import org.jpox.store.expression.LogicSetExpression;
import org.jpox.store.expression.NumericExpression;
import org.jpox.store.expression.QueryExpression;
import org.jpox.store.expression.ScalarExpression;
import org.jpox.store.expression.TableExprAsJoins;
import org.jpox.store.rdbms.Column;
import org.jpox.store.rdbms.key.PrimaryKey;
import org.jpox.store.rdbms.table.Table;

/**
 * Provides methods for adapting SQL language elements to the H2 Database Engine.
 *
 * @version $Revision: 1.1 $ 
 */
class H2Adapter extends DatabaseAdapter
{
    private String schemaName;
    
    /**
     * Constructs a H2 adapter based on the given JDBC metadata.
     * @param dictionary The Dictionary to use
     * @param metadata the database metadata.
     */
    public H2Adapter(Dictionary dictionary, DatabaseMetaData metadata)
    {
        super(dictionary, metadata);

        // Set schema name
        try
        {
            ResultSet rs = metadata.getSchemas();
            while (rs.next())
            {
                if (rs.getBoolean("IS_DEFAULT"))
                {
                    schemaName = rs.getString("TABLE_SCHEM");
                }
            }
        }
        catch (SQLException e)
        {
            e.printStackTrace();
            // ignore
        }
    }

    /**
     * Getter for the vendor ID for this adapter.
     * @return The vendor ID
     */
    public String getVendorID()
    {
        return "h2";
    }

    /**
     * Accessor for a Connection to the datastore.
     * @param ds The data source. Possible to have more than one data source for fail over
     * @param userName The username for the datastore
     * @param password The password for the datastore
     * @param isolationLevel The level of transaction isolation
     * @return The Connection
     * @throws SQLException Thrown when an error occurs in the creation.
     **/
    public Connection getConnection(DataSource[] ds, String userName, String password, int isolationLevel)
    throws SQLException
    {
        return super.getConnection(ds,userName,password,Connection.TRANSACTION_SERIALIZABLE);
    }
    
    /**
     * Accessor for the maximum table name length permitted on this
     * datastore.
     * @return Max table name length
     **/
    public int getMaxTableNameLength()
    {
        return SQLConstants.MAX_IDENTIFIER_LENGTH;
    }

    /**
     * Accessor for the maximum constraint name length permitted on this
     * datastore.
     * @return Max constraint name length
     **/
    public int getMaxConstraintNameLength()
    {
        return SQLConstants.MAX_IDENTIFIER_LENGTH;
    }

    /**
     * Accessor for the maximum index name length permitted on this datastore.
     * @return Max index name length
     **/
    public int getMaxIndexNameLength()
    {
        return SQLConstants.MAX_IDENTIFIER_LENGTH;
    }

    /**
     * Accessor for the maximum column name length permitted on this datastore.
     * @return Max column name length
     **/
    public int getMaxColumnNameLength()
    {
        return SQLConstants.MAX_IDENTIFIER_LENGTH;
    }

    /**
     * Accessor for the SQL statement to add a column to a table.
     * @param table The table
     * @param col The column
     * @return The SQL necessary to add the column
     */
    public String getAddColumnStatement(DatastoreContainerObject table, Column col)
    {
        return "ALTER TABLE " + table.toString() + " ADD COLUMN " + col.getSQLDefinition();
    }

    /**
     * Method to return the SQL to append to the SELECT clause of a SELECT statement to handle
     * restriction of ranges using the LIMIT keyword.
     * @param offset The offset to return from
     * @param count The number of items to return
     * @return The SQL to append to allow for ranges using LIMIT.
     */
    public String getRangeByLimitSelectClause(long offset, long count)
    {
        if (offset >= 0 && count > 0)
        {
            return " LIMIT " + offset + " " + count + " ";
        }
        else if (offset <= 0 && count > 0)
        {
            return " LIMIT 0 " + count + " ";
        }
        else
        {
            return "";
        }
    }

    /**
     * Accessor for whether the adapter supports the transaction isolation level
     * 
     * @param isolationLevel the isolation level
     * @return Whether the transaction isolation level setting is supported.
     */
    public boolean supportsTransactionIsolationLevel(int isolationLevel)
    {
        if (isolationLevel == Connection.TRANSACTION_READ_COMMITTED || isolationLevel == Connection.TRANSACTION_SERIALIZABLE)
        {
            return true;
        }
        return false;
    }

    /**
     * Whether the datastore supports specification of the primary key in CREATE
     * TABLE statements.
     * @return Whether it allows "PRIMARY KEY ..."
     */
    public boolean supportsPrimaryKeyInCreateStatements()
    {
        return true;
    }

    /**
     * Accessor for the Schema Name for this datastore.
     * 
     * @param conn Connection to the datastore
     * @return The schema name
     **/
    public String getSchemaName(Connection conn)
    throws SQLException
    {
        return schemaName;
    }

    /**
     * @param pk An object describing the primary key.
     * @return The PK statement
     */
    public String getAddPrimaryKeyStatement(PrimaryKey pk)
    {
        // PK is created by the CREATE TABLE statement so we just return null
        return null;
    }


    /**
     * Returns the appropriate SQL to drop the given table.
     * It should return something like:
     * <p>
     * <blockquote><pre>
     * DROP TABLE FOO
     * </pre></blockquote>
     *
     * @param table     The table to drop.
     * @return  The text of the SQL statement.
     */
    public String getDropTableStatement(DatastoreContainerObject table)
    {
        return "DROP TABLE " + table.toString();
    }

    /**
     * Whether we support deferred constraints in keys.
     * @return whether we support deferred constraints in keys.
     **/
    public boolean supportsDeferredConstraints()
    {
        return false;
    }

    /**
     * Whether we support auto incrementing fields.
     * @return whether we support auto incrementing fields.
     **/
    public boolean supportsAutoIncrementFields()
    {
        return true;
    }

    /**
     * Accessor for the auto-increment sql statement for this datastore.
     * @param tableName Name of the table that the autoincrement is for
     * @param columnName Name of the column that the autoincrement is for
     * @return The statement for getting the latest auto-increment key
     **/
    public String getAutoIncrementStmt(String tableName, String columnName)
    {
        return "CALL IDENTITY()";
    }

    /**
     * Accessor for the auto-increment keyword for generating DDLs (CREATE TABLE...).
     * @return The keyword for a column using auto-increment
     **/
    public String getAutoIncrementKeyword()
    {
        return "IDENTITY";
    }

    /**
     * Method to return the INSERT statement to use when inserting into a table that has no
     * columns specified. This is the case when we have a single column in the table and that column
     * is autoincrement/identity (and so is assigned automatically in the datastore).
     * @param table The table
     * @return The INSERT statement
     */
    public String getInsertStatementForNoColumns(Table table)
    {
        return "INSERT INTO " + table.toString() + " VALUES(NULL)";
    }

    /**
     * Whether to allow Unique statements in the section of CREATE TABLE after the
     * column definitions.
     * @see org.jpox.store.rdbms.adapter.DatabaseAdapter#supportsUniqueConstraintsInEndCreateStatements()
     */
    public boolean supportsUniqueConstraintsInEndCreateStatements()
    {
        return true;
    }

    /**
     * Whether this datastore supports the use of CHECK after the column
     * definitions in CREATE TABLE statements (DDL).
     * e.g.
     * CREATE TABLE XYZ
     * (
     *   COL_A int,
     *   COL_B char(1),
     *   PRIMARY KEY (COL_A),
     *   CHECK (COL_B IN ('Y','N'))
     * )
     * @return whether we can use CHECK after the column definitions in CREATE TABLE.
     **/
    public boolean supportsCheckConstraintsInEndCreateStatements()
    {
        return true;
    }

    /**
     * Accessor for whether the specified type is allow to be part of a PK.
     * @param datatype The JDBC type
     * @return Whether it is permitted in the PK
     */
    public boolean isValidPrimaryKeyType(int datatype)
    {
        return true;
    }

    /**
     * Method to generate a modulus expression. The binary % operator is said to
     * yield the remainder of its operands from an implied division; the
     * left-hand operand is the dividend and the right-hand operand is the
     * divisor. This returns MOD(expr1, expr2).
     * @param operand1 the left expression
     * @param operand2 the right expression
     * @return The Expression for modulus
     */
    public NumericExpression modOperator(ScalarExpression operand1, ScalarExpression operand2)
    {
        ArrayList args = new ArrayList();
        args.add(operand1);
        args.add(operand2);
        return new NumericExpression("MOD", args);
    }
    /**
     * Return a new TableExpression.
     * @param qs The QueryStatement to add the expression to
     * @param table The table in the expression
     * @param rangeVar range variable to assign to the expression.
     * @return The expression.
     **/ 
    public LogicSetExpression newTableExpression(QueryExpression qs, DatastoreContainerObject table, DatastoreIdentifier rangeVar)
    {
        return new TableExprAsJoins(qs, table, rangeVar);
    }
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
wwwwww.欧美系列| 中文字幕一区二区三区不卡在线| 成人激情电影免费在线观看| 久久99精品久久久久婷婷| 奇米精品一区二区三区在线观看 | 制服丝袜日韩国产| 在线免费观看日本一区| 一本一道久久a久久精品综合蜜臀| 成人午夜大片免费观看| 丁香桃色午夜亚洲一区二区三区| 国产 欧美在线| 99国产精品久久久久久久久久| 91麻豆精品视频| 欧美色视频在线观看| 欧美猛男男办公室激情| 日韩欧美区一区二| 久久精品在线观看| 18成人在线观看| 一区二区三区四区不卡在线| 亚洲一二三区视频在线观看| 日韩电影在线一区二区三区| 免费精品视频在线| 国产在线麻豆精品观看| 成人黄色电影在线| 欧美日韩一区成人| 久久色视频免费观看| 中文字幕日韩一区| 亚洲第一福利视频在线| 精品制服美女久久| 99精品国产91久久久久久 | 欧美a一区二区| 国产精品亚洲第一区在线暖暖韩国 | 日本韩国欧美三级| 欧美另类高清zo欧美| 久久精品无码一区二区三区| 一区二区三区国产精品| 免费观看成人鲁鲁鲁鲁鲁视频| 国产高清不卡一区二区| 欧洲亚洲精品在线| 久久综合九色综合欧美98| 亚洲免费av高清| 久久99国产精品久久99| 91丨九色丨国产丨porny| 日韩天堂在线观看| 亚洲免费在线播放| 国产一区二区在线看| 在线视频观看一区| 欧美国产国产综合| 久久99国产精品久久| 精品视频在线免费观看| 国产精品久久久久久久久果冻传媒 | 色婷婷激情综合| 2023国产精品自拍| 日韩精品一二三四| 色婷婷av一区二区三区gif | 岛国一区二区三区| 日韩午夜电影av| 亚洲成人在线免费| 色噜噜狠狠色综合欧洲selulu| 久久精品免费在线观看| 青青草原综合久久大伊人精品 | 精品剧情在线观看| 亚洲不卡av一区二区三区| 丁香一区二区三区| 久久久久久久性| 久久国产精品99久久人人澡| 欧美精品日韩综合在线| 亚洲午夜免费电影| 色88888久久久久久影院野外| 中文天堂在线一区| 国产成人免费视| 国产亚洲欧洲一区高清在线观看| 日韩电影一区二区三区| 69堂国产成人免费视频| 亚洲福利视频三区| 欧美日韩日日夜夜| 亚洲国产精品久久人人爱蜜臀| 色欧美片视频在线观看| 亚洲精品国产一区二区精华液 | 亚洲日本丝袜连裤袜办公室| 国产精品99精品久久免费| 欧美精品一区二区久久久| 免费成人在线网站| 91精品国产品国语在线不卡| 偷拍一区二区三区| 91精品中文字幕一区二区三区 | 欧美mv日韩mv| 激情偷乱视频一区二区三区| 久久久久久黄色| www.av亚洲| 亚洲二区在线视频| 欧美精品乱码久久久久久按摩| 午夜伦理一区二区| 欧美成人伊人久久综合网| 国产一区二区成人久久免费影院| 久久久久久久久久久久久女国产乱| 国产在线播精品第三| 日本一区二区三区dvd视频在线| 成人av电影在线观看| 亚洲欧美一区二区不卡| 欧美日韩一级黄| 国产一区二区成人久久免费影院| 国产日韩欧美制服另类| 色综合久久综合中文综合网| 日韩va亚洲va欧美va久久| 精品国产凹凸成av人导航| 成人毛片视频在线观看| 亚洲一区在线看| 亚洲精品一区二区三区香蕉| 国产成人av资源| 亚洲国产毛片aaaaa无费看| 精品国产91亚洲一区二区三区婷婷| 国产精品99久| 亚洲成人av电影在线| 337p粉嫩大胆色噜噜噜噜亚洲| 91丝袜呻吟高潮美腿白嫩在线观看| 欧美色区777第一页| 亚洲综合色区另类av| 国产尤物一区二区| 日韩美女精品在线| www国产亚洲精品久久麻豆| 日本高清无吗v一区| 国产乱色国产精品免费视频| 亚洲三级久久久| 精品福利一二区| 欧美日韩在线综合| 国产成人综合在线观看| 奇米影视在线99精品| 亚洲日本在线天堂| 久久久午夜精品理论片中文字幕| 欧美精彩视频一区二区三区| 欧美日韩不卡一区| av中文字幕在线不卡| 另类小说图片综合网| 亚洲综合成人网| 国产精品久久久久久久久图文区 | 久久久久久免费网| 欧美国产激情二区三区| 国产一区二区中文字幕| 精品国产一区二区三区四区四| 国产在线精品不卡| 一区二区三区欧美视频| 国产精品毛片久久久久久| 欧美电视剧免费全集观看| 6080国产精品一区二区| 欧美午夜精品电影| 91麻豆产精品久久久久久| 国产 欧美在线| 国产精品一区二区无线| 久久国产精品区| 极品少妇xxxx偷拍精品少妇| 日本aⅴ亚洲精品中文乱码| 日韩中文字幕区一区有砖一区| 一个色妞综合视频在线观看| 亚洲欧美视频一区| 亚洲综合清纯丝袜自拍| 亚洲欧美日韩成人高清在线一区| 国产精品欧美一区二区三区| 国产欧美日韩在线观看| 欧美激情综合网| 亚洲欧洲日产国码二区| 亚洲成av人综合在线观看| 欧美性欧美巨大黑白大战| 成人欧美一区二区三区在线播放| 亚洲v日本v欧美v久久精品| 亚洲欧洲日韩一区二区三区| 国产精品不卡在线观看| 亚洲欧美偷拍另类a∨色屁股| 亚洲欧美另类久久久精品2019| 亚洲三级免费电影| 亚洲一区二区在线免费看| 亚洲成人一区在线| 精品综合久久久久久8888| 国产精品主播直播| 成人97人人超碰人人99| 色呦呦一区二区三区| 7777精品伊人久久久大香线蕉完整版 | 精品免费视频一区二区| 久久久99久久精品欧美| 欧美日韩综合在线免费观看| 色天天综合色天天久久| 欧美三片在线视频观看| 91精品国产综合久久久久久久久久| 日韩欧美视频一区| 国产精品久久久久久久久免费丝袜 | 波多野结衣亚洲| 在线看国产日韩| 欧美成人vps| 国产精品国产三级国产aⅴ入口| 亚洲精品乱码久久久久久| 精品一区二区三区视频 | 欧美亚洲愉拍一区二区| 欧美成人a视频| 亚洲精品国产无天堂网2021| 麻豆精品视频在线| 国产精品美女久久久久久久久| 日韩av电影免费观看高清完整版在线观看| 午夜欧美大尺度福利影院在线看| 国产电影一区二区三区| 色av综合在线|