當前位置: 首頁>>代碼示例>>Java>>正文


Java Database.getSettings方法代碼示例

本文整理匯總了Java中org.h2.engine.Database.getSettings方法的典型用法代碼示例。如果您正苦於以下問題:Java Database.getSettings方法的具體用法?Java Database.getSettings怎麽用?Java Database.getSettings使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.h2.engine.Database的用法示例。


在下文中一共展示了Database.getSettings方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getFunction

import org.h2.engine.Database; //導入方法依賴的package包/類
/**
 * Get an instance of the given function for this database.
 * If no function with this name is found, null is returned.
 *
 * @param database the database
 * @param name the function name
 * @return the function object or null
 */
public static Function getFunction(Database database, String name) {
    if (!database.getSettings().databaseToUpper) {
        // if not yet converted to uppercase, do it now
        name = StringUtils.toUpperEnglish(name);
    }
    FunctionInfo info = getFunctionInfo(name);
    if (info == null) {
        return null;
    }
    switch(info.type) {
    case TABLE:
    case TABLE_DISTINCT:
        return new TableFunction(database, info, Long.MAX_VALUE);
    default:
        return new Function(database, info);
    }
}
 
開發者ID:vdr007,項目名稱:ThriftyPaxos,代碼行數:26,代碼來源:Function.java

示例2: Store

import org.h2.engine.Database; //導入方法依賴的package包/類
public Store(Database db, MVStore.Builder builder) {
    this.store = builder.open();
    if (!db.getSettings().reuseSpace) {
        store.setReuseSpace(false);
    }
    this.transactionStore = new TransactionStore(
            store,
            new ValueDataType(null, db, null));
    transactionStore.init();
}
 
開發者ID:vdr007,項目名稱:ThriftyPaxos,代碼行數:11,代碼來源:MVTableEngine.java

示例3: needRecompile

import org.h2.engine.Database; //導入方法依賴的package包/類
/**
 * Check if the statement needs to be re-compiled.
 *
 * @return true if it must
 */
public boolean needRecompile() {
    Database db = session.getDatabase();
    if (db == null) {
        throw DbException.get(ErrorCode.CONNECTION_BROKEN_1, "database closed");
    }
    // parser: currently, compiling every create/drop/... twice
    // because needRecompile return true even for the first execution
    return prepareAlways ||
            modificationMetaId < db.getModificationMetaId() ||
            db.getSettings().recompileAlways;
}
 
開發者ID:vdr007,項目名稱:ThriftyPaxos,代碼行數:17,代碼來源:Prepared.java

示例4: CompareLike

import org.h2.engine.Database; //導入方法依賴的package包/類
public CompareLike(Database db, Expression left, Expression right,
        Expression escape, boolean regexp) {
    this(db.getCompareMode(), db.getSettings().defaultEscape, left, right,
            escape, regexp);
}
 
開發者ID:vdr007,項目名稱:ThriftyPaxos,代碼行數:6,代碼來源:CompareLike.java

示例5: getCreateSQL

import org.h2.engine.Database; //導入方法依賴的package包/類
@Override
public String getCreateSQL() {
    Database db = getDatabase();
    if (db == null) {
        // closed
        return null;
    }
    StatementBuilder buff = new StatementBuilder("CREATE ");
    if (isTemporary()) {
        if (isGlobalTemporary()) {
            buff.append("GLOBAL ");
        } else {
            buff.append("LOCAL ");
        }
        buff.append("TEMPORARY ");
    } else if (isPersistIndexes()) {
        buff.append("CACHED ");
    } else {
        buff.append("MEMORY ");
    }
    buff.append("TABLE ");
    if (isHidden) {
        buff.append("IF NOT EXISTS ");
    }
    buff.append(getSQL());
    if (comment != null) {
        buff.append(" COMMENT ").append(StringUtils.quoteStringSQL(comment));
    }
    buff.append("(\n    ");
    for (Column column : columns) {
        buff.appendExceptFirst(",\n    ");
        buff.append(column.getCreateSQL());
    }
    buff.append("\n)");
    if (tableEngine != null) {
        DbSettings s = db.getSettings();
        String d = s.defaultTableEngine;
        if (d == null && s.mvStore) {
            d = MVTableEngine.class.getName();
        }
        if (d == null || !tableEngine.endsWith(d)) {
            buff.append("\nENGINE ");
            buff.append(StringUtils.quoteIdentifier(tableEngine));
        }
    }
    if (!tableEngineParams.isEmpty()) {
        buff.append("\nWITH ");
        buff.resetCount();
        for (String parameter : tableEngineParams) {
            buff.appendExceptFirst(", ");
            buff.append(StringUtils.quoteIdentifier(parameter));
        }
    }
    if (!isPersistIndexes() && !isPersistData()) {
        buff.append("\nNOT PERSISTENT");
    }
    if (isHidden) {
        buff.append("\nHIDDEN");
    }
    return buff.toString();
}
 
開發者ID:vdr007,項目名稱:ThriftyPaxos,代碼行數:62,代碼來源:TableBase.java


注:本文中的org.h2.engine.Database.getSettings方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。