当前位置: 首页>>代码示例>>Java>>正文


Java DatabaseURL.isFileBasedDatabaseType方法代码示例

本文整理汇总了Java中org.hsqldb.DatabaseURL.isFileBasedDatabaseType方法的典型用法代码示例。如果您正苦于以下问题:Java DatabaseURL.isFileBasedDatabaseType方法的具体用法?Java DatabaseURL.isFileBasedDatabaseType怎么用?Java DatabaseURL.isFileBasedDatabaseType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.hsqldb.DatabaseURL的用法示例。


在下文中一共展示了DatabaseURL.isFileBasedDatabaseType方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: save

import org.hsqldb.DatabaseURL; //导入方法依赖的package包/类
public void save() {

        if (!DatabaseURL.isFileBasedDatabaseType(database.getType())
                || database.isFilesReadOnly() || database.isFilesInJar()) {
            return;
        }

        try {
            super.save(fileName + ".properties" + ".new");
            fa.renameElement(fileName + ".properties" + ".new",
                             fileName + ".properties");
        } catch (Exception e) {
            database.logger.appLog.logContext(SimpleLog.LOG_ERROR, "failed");

            throw Error.error(ErrorCode.FILE_IO_ERROR,
                              ErrorCode.M_LOAD_SAVE_PROPERTIES, new Object[] {
                fileName, e
            });
        }
    }
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:21,代码来源:HsqlDatabaseProperties.java

示例2: save

import org.hsqldb.DatabaseURL; //导入方法依赖的package包/类
public void save() throws HsqlException {

        if (!DatabaseURL.isFileBasedDatabaseType(database.getType())
                || database.isFilesReadOnly() || database.isFilesInJar()) {
            return;
        }

        try {
            super.save(fileName + ".properties" + ".new");
            fa.renameElement(fileName + ".properties" + ".new",
                             fileName + ".properties");
        } catch (Exception e) {
            database.logger.appLog.logContext(SimpleLog.LOG_ERROR, "failed");

            throw Trace.error(Trace.FILE_IO_ERROR, Trace.LOAD_SAVE_PROPERTIES,
                              new Object[] {
                fileName, e
            });
        }
    }
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:21,代码来源:HsqlDatabaseProperties.java

示例3: open

import org.hsqldb.DatabaseURL; //导入方法依赖的package包/类
public void open() {

        if (DatabaseURL.isFileBasedDatabaseType(database.getType())) {
            lobStore = new LobStoreRAFile(database, lobBlockSize);
        } else {
            lobStore = new LobStoreMem(lobBlockSize);
        }
    }
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:9,代码来源:LobManager.java

示例4: save

import org.hsqldb.DatabaseURL; //导入方法依赖的package包/类
public void save() {

        if (!DatabaseURL.isFileBasedDatabaseType(database.getType())
                || database.isFilesReadOnly() || database.isFilesInJar()) {
            return;
        }

        try {
            HsqlProperties props = new HsqlProperties(dbMeta,
                database.getPath(), database.logger.getFileAccess(), false);

            if (getIntegerProperty(hsqldb_script_format) == 3) {
                props.setProperty(hsqldb_script_format, 3);
            }

            props.setProperty(hsqldb_version, THIS_VERSION);

            if (database.logger.isStoredFileAccess()) {
                if (!database.logger.isNewStoredFileAccess()) {

// when jar is used with embedded databases in AOO 3.4 and recent(2012) LO this
// line can be uncommented to circumvent hard-coded check in OOo code in
// drivers/hsqldb/HDriver.cxx
//                    props.setProperty(hsqldb_version, VERSION_STRING_1_8_0);
                }
            }

            props.setProperty(hsqldb_modified, getProperty(hsqldb_modified));
            props.save(fileName + ".properties" + ".new");
            fa.renameElement(fileName + ".properties" + ".new",
                             fileName + ".properties");
        } catch (Throwable t) {
            database.logger.logSevereEvent("save failed", t);

            throw Error.error(t, ErrorCode.FILE_IO_ERROR,
                              ErrorCode.M_LOAD_SAVE_PROPERTIES, new Object[] {
                t.toString(), fileName
            });
        }
    }
 
开发者ID:Julien35,项目名称:dev-courses,代码行数:41,代码来源:HsqlDatabaseProperties.java

示例5: save

import org.hsqldb.DatabaseURL; //导入方法依赖的package包/类
public void save() {

        if (!DatabaseURL.isFileBasedDatabaseType(database.getType())
                || database.isFilesReadOnly() || database.isFilesInJar()) {
            return;
        }

        try {
            HsqlProperties props = new HsqlProperties(dbMeta,
                database.getPath(), database.logger.getFileAccess(), false);

            if (getIntegerProperty(hsqldb_script_format) == 3) {
                props.setProperty(hsqldb_script_format, 3);
            }

            props.setProperty(hsqldb_version, THIS_VERSION);
            props.setProperty(hsqldb_modified, getProperty(hsqldb_modified));
            props.save(fileName + ".properties" + ".new");
            fa.renameElement(fileName + ".properties" + ".new",
                             fileName + ".properties");
        } catch (Throwable t) {
            database.logger.logSevereEvent("save failed", t);

            throw Error.error(t, ErrorCode.FILE_IO_ERROR,
                              ErrorCode.M_LOAD_SAVE_PROPERTIES, new Object[] {
                t.toString(), fileName
            });
        }
    }
 
开发者ID:RabadanLab,项目名称:Pegasus,代码行数:30,代码来源:HsqlDatabaseProperties.java

示例6: load

import org.hsqldb.DatabaseURL; //导入方法依赖的package包/类
/**
 * Creates file with defaults if it didn't exist.
 * Returns false if file already existed.
 */
public boolean load() {

    boolean exists;

    if (!DatabaseURL.isFileBasedDatabaseType(database.getType())) {
        return true;
    }

    try {
        exists = super.load();
    } catch (Exception e) {
        throw Error.error(ErrorCode.FILE_IO_ERROR,
                          ErrorCode.M_LOAD_SAVE_PROPERTIES, new Object[] {
            fileName, e
        });
    }

    if (!exists) {
        return false;
    }

    filterLoadedProperties();

    String version = getProperty(hsqldb_compatible_version);

    // do not open if the database belongs to a later (future) version
    int check = version.substring(0, 5).compareTo(THIS_VERSION);

    if (check > 0) {
        throw Error.error(ErrorCode.WRONG_DATABASE_FILE_VERSION);
    }

    version = getProperty(db_version);

    if (version.charAt(2) == '6') {
        setProperty(hsqldb_cache_version, "1.6.0");
    }

    JavaSystem.gcFrequency = getIntegerProperty(runtime_gc_interval, 0);

    return true;
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:47,代码来源:HsqlDatabaseProperties.java

示例7: load

import org.hsqldb.DatabaseURL; //导入方法依赖的package包/类
/**
 * Creates file with defaults if it didn't exist.
 * Returns false if file already existed.
 */
public boolean load() {

    boolean exists;

    if (!DatabaseURL.isFileBasedDatabaseType(database.getType())) {
        return true;
    }

    try {
        exists = super.load();
    } catch (Throwable t) {
        throw Error.error(t, ErrorCode.FILE_IO_ERROR,
                          ErrorCode.M_LOAD_SAVE_PROPERTIES, new Object[] {
            t.toString(), fileName
        });
    }

    if (!exists) {
        return false;
    }

    filterLoadedProperties();

    String version = getStringProperty(hsqldb_version);
    int    check = version.substring(0, 5).compareTo(VERSION_STRING_1_8_0);

    // do not open early version databases
    if (check < 0) {
        throw Error.error(ErrorCode.WRONG_DATABASE_FILE_VERSION);
    }

    // do not open databases of 1.8 versions if script format is not compatible
    if (check == 0) {
        if (getIntegerProperty(hsqldb_script_format) != 0) {
            throw Error.error(ErrorCode.WRONG_DATABASE_FILE_VERSION);
        }
    }

    check = version.substring(0, 2).compareTo(THIS_VERSION);

    // do not open if the database belongs to a later (future) version (3.x)
    if (check > 0) {
        throw Error.error(ErrorCode.WRONG_DATABASE_FILE_VERSION);
    }

    return true;
}
 
开发者ID:Julien35,项目名称:dev-courses,代码行数:52,代码来源:HsqlDatabaseProperties.java

示例8: load

import org.hsqldb.DatabaseURL; //导入方法依赖的package包/类
/**
 * Creates file with defaults if it didn't exist.
 * Returns false if file already existed.
 */
public boolean load() throws HsqlException {

    boolean exists;

    if (!DatabaseURL.isFileBasedDatabaseType(database.getType())) {
        return true;
    }

    try {
        exists = super.load();
    } catch (Exception e) {
        throw Trace.error(Trace.FILE_IO_ERROR, Trace.LOAD_SAVE_PROPERTIES,
                          new Object[] {
            fileName, e
        });
    }

    if (!exists) {
        return false;
    }

    filterLoadedProperties();

    String version = getProperty(hsqldb_compatible_version);

    // do not open if the database belongs to a later (future) version
    int check = version.substring(0, 5).compareTo(THIS_VERSION);

    if (check > 0) {
        throw Trace.error(Trace.WRONG_DATABASE_FILE_VERSION);
    }

    version = getProperty(db_version);

    if (version.charAt(2) == '6') {
        setProperty(hsqldb_cache_version, "1.6.0");
    }

    JavaSystem.gcFrequency = getIntegerProperty(runtime_gc_interval, 0);

    return true;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:47,代码来源:HsqlDatabaseProperties.java


注:本文中的org.hsqldb.DatabaseURL.isFileBasedDatabaseType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。