本文整理汇总了Java中org.hsqldb.Database.getProperties方法的典型用法代码示例。如果您正苦于以下问题:Java Database.getProperties方法的具体用法?Java Database.getProperties怎么用?Java Database.getProperties使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.hsqldb.Database
的用法示例。
在下文中一共展示了Database.getProperties方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: Log
import org.hsqldb.Database; //导入方法依赖的package包/类
Log(Database db) {
database = db;
fa = db.logger.getFileAccess();
baseFileName = db.getPath();
properties = db.getProperties();
}
示例2: Log
import org.hsqldb.Database; //导入方法依赖的package包/类
Log(Database db) {
database = db;
fa = db.getFileAccess();
fileName = db.getPath();
properties = db.getProperties();
}
示例3: Log
import org.hsqldb.Database; //导入方法依赖的package包/类
Log(Database db) {
database = db;
fa = db.logger.getFileAccess();
fileName = db.getPath();
properties = db.getProperties();
}
示例4: initParams
import org.hsqldb.Database; //导入方法依赖的package包/类
/**
* initial external parameters are set here.
*/
protected void initParams(Database database,
String baseFileName) throws HsqlException {
HsqlDatabaseProperties props = database.getProperties();
fileName = baseFileName + ".data";
backupFileName = baseFileName + ".backup";
this.database = database;
fa = database.getFileAccess();
int cacheScale =
props.getIntegerProperty(HsqlDatabaseProperties.hsqldb_cache_scale,
14, 8, 18);
int cacheSizeScale = props.getIntegerProperty(
HsqlDatabaseProperties.hsqldb_cache_size_scale, 10, 6, 20);
int cacheFreeCountScale = props.getIntegerProperty(
HsqlDatabaseProperties.hsqldb_cache_free_count_scale, 9, 6, 12);
incBackup = database.getProperties().isPropertyTrue(
HsqlDatabaseProperties.hsqldb_inc_backup);
cacheFileScale = database.getProperties().getIntegerProperty(
HsqlDatabaseProperties.hsqldb_cache_file_scale, 8);
if (cacheFileScale != 1) {
cacheFileScale = 8;
}
cacheReadonly = database.isFilesReadOnly();
int lookupTableLength = 1 << cacheScale;
int avgRowBytes = 1 << cacheSizeScale;
maxCacheSize = lookupTableLength * 3;
maxCacheBytes = maxCacheSize * avgRowBytes;
maxDataFileSize = (long) Integer.MAX_VALUE * cacheFileScale;
maxFreeBlocks = 1 << cacheFreeCountScale;
dataFile = null;
shadowFile = null;
}
示例5: Log
import org.hsqldb.Database; //导入方法依赖的package包/类
Log(Database db) throws HsqlException {
database = db;
fa = db.getFileAccess();
fileName = db.getPath();
properties = db.getProperties();
}
示例6: initParams
import org.hsqldb.Database; //导入方法依赖的package包/类
/**
* initial external parameters are set here.
*/
protected void initParams(Database database,
String baseFileName) throws HsqlException {
HsqlDatabaseProperties props = database.getProperties();
fileName = baseFileName + ".data";
backupFileName = baseFileName + ".backup";
this.database = database;
fa = database.getFileAccess();
int cacheScale =
props.getIntegerProperty(HsqlDatabaseProperties.hsqldb_cache_scale,
14, 8, 18);
int cacheSizeScale = props.getIntegerProperty(
HsqlDatabaseProperties.hsqldb_cache_size_scale, 10, 6, 20);
int cacheFreeCountScale = props.getIntegerProperty(
HsqlDatabaseProperties.hsqldb_cache_free_count_scale, 9, 6, 12);
cacheFileScale = database.getProperties().getIntegerProperty(
HsqlDatabaseProperties.hsqldb_cache_file_scale, 1);
if (cacheFileScale != 1) {
cacheFileScale = 8;
}
cacheReadonly = database.isFilesReadOnly();
int lookupTableLength = 1 << cacheScale;
int avgRowBytes = 1 << cacheSizeScale;
maxCacheSize = lookupTableLength * 3;
maxCacheBytes = maxCacheSize * avgRowBytes;
maxDataFileSize = cacheFileScale == 1 ? Integer.MAX_VALUE
: (long) Integer.MAX_VALUE * 4;
maxFreeBlocks = 1 << cacheFreeCountScale;
dataFile = null;
}
示例7: initParams
import org.hsqldb.Database; //导入方法依赖的package包/类
protected void initParams(Database database, String baseFileName) {
fileName = baseFileName;
this.database = database;
fa = FileUtil.getDefaultInstance();
HsqlProperties tableprops =
HsqlProperties.delimitedArgPairsToProps(fileName, "=", ";", null);
// source file name is the only key without a value
fileName = tableprops.errorKeys[0].trim();
//-- Get separators:
HsqlDatabaseProperties dbProps = database.getProperties();
fs = translateSep(tableprops.getProperty("fs",
dbProps.getProperty(HsqlDatabaseProperties.textdb_fs, ",")));
vs = translateSep(tableprops.getProperty("vs",
dbProps.getProperty(HsqlDatabaseProperties.textdb_vs, fs)));
lvs = translateSep(tableprops.getProperty("lvs",
dbProps.getProperty(HsqlDatabaseProperties.textdb_lvs, fs)));
//-- Get booleans
ignoreFirst = tableprops.isPropertyTrue(
"ignore_first",
dbProps.isPropertyTrue(
HsqlDatabaseProperties.textdb_ignore_first, false));
isQuoted = tableprops.isPropertyTrue(
"quoted",
dbProps.isPropertyTrue(
HsqlDatabaseProperties.textdb_quoted, true));
isAllQuoted = tableprops.isPropertyTrue(
"all_quoted",
dbProps.isPropertyTrue(
HsqlDatabaseProperties.textdb_all_quoted, false));
//-- Get encoding
stringEncoding = translateSep(tableprops.getProperty("encoding",
dbProps.getProperty(HsqlDatabaseProperties.textdb_encoding,
"ASCII")));
//-- Get size and scale
int cacheScale = tableprops.getIntegerProperty(
"cache_scale",
dbProps.getIntegerProperty(
HsqlDatabaseProperties.textdb_cache_scale, 10, 8, 16));
int cacheSizeScale = tableprops.getIntegerProperty(
"cache_size_scale",
dbProps.getIntegerProperty(
HsqlDatabaseProperties.textdb_cache_size_scale, 10, 8, 20));
int lookupTableLength = 1 << cacheScale;
int avgRowBytes = 1 << cacheSizeScale;
maxCacheSize = lookupTableLength * 3;
maxCacheBytes = maxCacheSize * avgRowBytes;
maxDataFileSize = Integer.MAX_VALUE;
cachedRowPadding = 1;
cacheFileScale = 1;
}
示例8: initParams
import org.hsqldb.Database; //导入方法依赖的package包/类
/**
* initial external parameters are set here.
*/
protected void initParams(Database database, String baseFileName) {
HsqlDatabaseProperties props = database.getProperties();
fileName = baseFileName + ".data";
backupFileName = baseFileName + ".backup";
this.database = database;
fa = database.getFileAccess();
int cacheScale =
props.getIntegerProperty(HsqlDatabaseProperties.hsqldb_cache_scale,
14, 8, 18);
int cacheSizeScale = props.getIntegerProperty(
HsqlDatabaseProperties.hsqldb_cache_size_scale, 10, 6, 20);
int cacheFreeCountScale = props.getIntegerProperty(
HsqlDatabaseProperties.hsqldb_cache_free_count_scale, 9, 6, 12);
incBackup = database.getProperties().isPropertyTrue(
HsqlDatabaseProperties.hsqldb_inc_backup);
cacheFileScale = database.getProperties().getIntegerProperty(
HsqlDatabaseProperties.hsqldb_cache_file_scale, 8);
if (cacheFileScale != 1) {
cacheFileScale = 8;
}
cachedRowPadding = 8;
if (cacheFileScale > 8) {
cachedRowPadding = cacheFileScale;
}
cacheReadonly = database.isFilesReadOnly();
int lookupTableLength = 1 << cacheScale;
int avgRowBytes = 1 << cacheSizeScale;
maxCacheSize = lookupTableLength * 3;
maxCacheBytes = maxCacheSize * avgRowBytes;
maxDataFileSize = cacheFileScale == 1 ? Integer.MAX_VALUE
: (long) Integer.MAX_VALUE
* cacheFileScale;
maxFreeBlocks = 1 << cacheFreeCountScale;
dataFile = null;
shadowFile = null;
}
示例9: initParams
import org.hsqldb.Database; //导入方法依赖的package包/类
protected void initParams(Database database,
String baseFileName) throws HsqlException {
fileName = baseFileName;
this.database = database;
fa = FileUtil.getDefaultInstance();
HsqlProperties tableprops =
HsqlProperties.delimitedArgPairsToProps(fileName, "=", ";", null);
//-- Get file name
switch (tableprops.errorCodes.length) {
case 0 :
throw Trace.error(Trace.TEXT_TABLE_SOURCE,
Trace.TEXT_TABLE_SOURCE_FILENAME);
case 1 :
// source file name is the only key without a value
fileName = tableprops.errorKeys[0].trim();
break;
default :
throw Trace.error(Trace.TEXT_TABLE_SOURCE,
Trace.TEXT_TABLE_SOURCE_VALUE_MISSING,
tableprops.errorKeys[1]);
}
//-- Get separators:
HsqlDatabaseProperties dbProps = database.getProperties();
fs = translateSep(tableprops.getProperty("fs",
dbProps.getProperty(HsqlDatabaseProperties.textdb_fs, ",")));
vs = translateSep(tableprops.getProperty("vs",
dbProps.getProperty(HsqlDatabaseProperties.textdb_vs, fs)));
lvs = translateSep(tableprops.getProperty("lvs",
dbProps.getProperty(HsqlDatabaseProperties.textdb_lvs, fs)));
if (fs.length() == 0 || vs.length() == 0 || lvs.length() == 0) {
throw Trace.error(Trace.TEXT_TABLE_SOURCE,
Trace.TEXT_TABLE_SOURCE_SEPARATOR);
}
//-- Get booleans
ignoreFirst = tableprops.isPropertyTrue(
"ignore_first",
dbProps.isPropertyTrue(
HsqlDatabaseProperties.textdb_ignore_first, false));
isQuoted = tableprops.isPropertyTrue(
"quoted",
dbProps.isPropertyTrue(
HsqlDatabaseProperties.textdb_quoted, true));
isAllQuoted = tableprops.isPropertyTrue(
"all_quoted",
dbProps.isPropertyTrue(
HsqlDatabaseProperties.textdb_all_quoted, false));
//-- Get encoding
stringEncoding = translateSep(tableprops.getProperty("encoding",
dbProps.getProperty(HsqlDatabaseProperties.textdb_encoding,
"ASCII")));
//-- Get size and scale
int cacheScale = tableprops.getIntegerProperty(
"cache_scale",
dbProps.getIntegerProperty(
HsqlDatabaseProperties.textdb_cache_scale, 10, 8, 16));
int cacheSizeScale = tableprops.getIntegerProperty(
"cache_size_scale",
dbProps.getIntegerProperty(
HsqlDatabaseProperties.textdb_cache_size_scale, 10, 8, 20));
int lookupTableLength = 1 << cacheScale;
int avgRowBytes = 1 << cacheSizeScale;
maxCacheSize = lookupTableLength * 3;
maxCacheBytes = maxCacheSize * avgRowBytes;
maxDataFileSize = Integer.MAX_VALUE;
cachedRowPadding = 1;
cacheFileScale = 1;
}