本文整理汇总了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
});
}
}
示例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
});
}
}
示例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);
}
}
示例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
});
}
}
示例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
});
}
}
示例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;
}
示例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;
}
示例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;
}