当前位置: 首页>>代码示例>>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;未经允许,请勿转载。