本文整理汇总了Java中org.hsqldb.DatabaseURL类的典型用法代码示例。如果您正苦于以下问题:Java DatabaseURL类的具体用法?Java DatabaseURL怎么用?Java DatabaseURL使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DatabaseURL类属于org.hsqldb包,在下文中一共展示了DatabaseURL类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setLocalVariables
import org.hsqldb.DatabaseURL; //导入依赖的package包/类
private void setLocalVariables() {
if (connProperties == null) {
return;
}
isCloseResultSet = connProperties.isPropertyTrue(
HsqlDatabaseProperties.url_close_result, false);
isUseColumnName = connProperties.isPropertyTrue(
HsqlDatabaseProperties.url_get_column_name, true);
isEmptyBatchAllowed = connProperties.isPropertyTrue(
HsqlDatabaseProperties.url_allow_empty_batch, false);
isTranslateTTIType = clientProperties.isPropertyTrue(
HsqlDatabaseProperties.jdbc_translate_tti_types, true);
isStoreLiveObject = clientProperties.isPropertyTrue(
HsqlDatabaseProperties.sql_live_object, false);
if (isStoreLiveObject) {
String connType = connProperties.getProperty("connection_type");
if(!DatabaseURL.S_MEM.equals(connType))
isStoreLiveObject = false;
}
}
示例2: acceptsURL
import org.hsqldb.DatabaseURL; //导入依赖的package包/类
/**
* Returns true if the driver thinks that it can open a connection to
* the given URL. Typically drivers will return true if they understand
* the subprotocol specified in the URL and false if they don't.
*
* @param url the URL of the database
* @return true if this driver can connect to the given URL
*/
// [email protected] - patch 1.7.0 - allow mixedcase url's
public boolean acceptsURL(String url) {
if (url == null) {
return false;
}
if (url.regionMatches(true, 0, DatabaseURL.S_URL_PREFIX, 0,
DatabaseURL.S_URL_PREFIX.length())) {
return true;
}
if (url.regionMatches(true, 0, DatabaseURL.S_URL_INTERNAL, 0,
DatabaseURL.S_URL_INTERNAL.length())) {
return true;
}
return false;
}
示例3: 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
});
}
}
示例4: 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
});
}
}
示例5: getSecurePath
import org.hsqldb.DatabaseURL; //导入依赖的package包/类
/**
* Returns a secure path or null for a user-defined path when
* hsqldb.allow_full_path is false. Returns the path otherwise.
*
*/
public String getSecurePath(String path) {
if (database.getType() == DatabaseURL.S_RES) {
return path;
}
if (path.indexOf("..") != -1) {
if (database.logger.propTextAllowFullPath) {
return FileUtil.getFileUtil().canonicalOrAbsolutePath(path);
} else {
return null;
}
}
String fullPath =
new File(new File(database.getPath()
+ ".properties").getAbsolutePath()).getParent();
if (fullPath != null) {
path = fullPath + File.separator + path;
}
return path;
}
示例6: open
import org.hsqldb.DatabaseURL; //导入依赖的package包/类
public void open() {
if (DatabaseURL.isFileBasedDatabaseType(database.getType())) {
lobStore = new LobStoreRAFile(database, lobBlockSize);
} else {
lobStore = new LobStoreMem(lobBlockSize);
}
}
示例7: acceptsURL
import org.hsqldb.DatabaseURL; //导入依赖的package包/类
/**
* Returns true if the driver thinks that it can open a connection to
* the given URL. Typically drivers will return true if they understand
* the subprotocol specified in the URL and false if they don't.
*
* @param url the URL of the database
* @return true if this driver can connect to the given URL
*/
// [email protected] - patch 1.7.0 - allow mixedcase url's
public boolean acceptsURL(String url) {
if (url == null) {
return false;
}
return url.regionMatches(true, 0, DatabaseURL.S_URL_PREFIX, 0,
DatabaseURL.S_URL_PREFIX.length());
}
示例8: open
import org.hsqldb.DatabaseURL; //导入依赖的package包/类
/**
* Opens a data source file.
*/
public void open(boolean readonly) {
fileFreePosition = 0;
try {
int type = database.getType() == DatabaseURL.S_RES
? RAFile.DATA_FILE_JAR
: RAFile.DATA_FILE_TEXT;
dataFile = RAFile.newScaledRAFile(database, dataFileName,
readonly, type);
fileFreePosition = dataFile.length();
if (fileFreePosition > maxDataFileSize) {
throw Error.error(ErrorCode.DATA_FILE_IS_FULL);
}
initBuffers();
spaceManager = new DataSpaceManagerSimple(this);
} catch (Throwable t) {
throw Error.error(t, ErrorCode.FILE_IO_ERROR,
ErrorCode.M_TextCache_opening_file_error,
new Object[] {
t.toString(), dataFileName
});
}
cacheReadonly = readonly;
}
示例9: 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
});
}
}
示例10: open
import org.hsqldb.DatabaseURL; //导入依赖的package包/类
public void open() {
lobBlockSize = database.logger.getLobBlockSize();
cryptLobs = database.logger.cryptLobs;
compressLobs = database.logger.propCompressLobs;
if (compressLobs || cryptLobs) {
int largeBufferBlockSize = largeLobBlockSize + 4 * 1024;
inflater = new Inflater();
deflater = new Deflater(Deflater.BEST_SPEED);
dataBuffer = new byte[largeBufferBlockSize];
}
if (database.getType() == DatabaseURL.S_RES) {
lobStore = new LobStoreInJar(database, lobBlockSize);
} else if (database.getType() == DatabaseURL.S_FILE) {
lobStore = new LobStoreRAFile(database, lobBlockSize);
if (!database.isFilesReadOnly()) {
byteBuffer = new byte[lobBlockSize];
initialiseLobSpace();
}
} else {
lobStore = new LobStoreMem(lobBlockSize);
byteBuffer = new byte[lobBlockSize];
initialiseLobSpace();
}
}
示例11: open
import org.hsqldb.DatabaseURL; //导入依赖的package包/类
/**
* Opens a data source file.
*/
public void open(boolean readonly) throws HsqlException {
fileFreePosition = 0;
try {
int type = database.getType() == DatabaseURL.S_RES
? ScaledRAFile.DATA_FILE_JAR
: ScaledRAFile.DATA_FILE_RAF;
dataFile = ScaledRAFile.newScaledRAFile(database, fileName,
readonly, type, null, null);
fileFreePosition = dataFile.length();
if (fileFreePosition > Integer.MAX_VALUE) {
throw new IOException();
}
initBuffers();
} catch (Exception e) {
throw Trace.error(Trace.FILE_IO_ERROR,
Trace.TextCache_openning_file_error,
new Object[] {
fileName, e
});
}
cacheReadonly = readonly;
}
示例12: openTextCache
import org.hsqldb.DatabaseURL; //导入依赖的package包/类
DataFileCache openTextCache(Table table, String source,
boolean readOnlyData,
boolean reversed) throws HsqlException {
closeTextCache(table);
if (database.getType() != DatabaseURL.S_RES
&& !properties.isPropertyTrue(
HsqlDatabaseProperties.textdb_allow_full_path)) {
if (source.indexOf("..") != -1) {
throw (Trace.error(Trace.ACCESS_IS_DENIED, source));
}
String path = new File(
new File(
database.getPath()
+ ".properties").getAbsolutePath()).getParent();
if (path != null) {
source = path + File.separator + source;
}
}
TextCache c;
int type;
if (reversed) {
c = new TextCache(table, source);
} else {
c = new TextCache(table, source);
}
c.open(readOnlyData || filesReadOnly);
textCacheList.put(table.getName(), c);
return c;
}
示例13: open
import org.hsqldb.DatabaseURL; //导入依赖的package包/类
/**
* Opens a data source file.
*/
public void open(boolean readonly) {
fileFreePosition = 0;
try {
int type = database.getType() == DatabaseURL.S_RES
? ScaledRAFile.DATA_FILE_JAR
: ScaledRAFile.DATA_FILE_TEXT;
dataFile = ScaledRAFile.newScaledRAFile(database, dataFileName,
readonly, type);
fileFreePosition = dataFile.length();
if (fileFreePosition > Integer.MAX_VALUE) {
throw Error.error(ErrorCode.DATA_FILE_IS_FULL);
}
initBuffers();
freeBlocks = new DataFileBlockManager(0, cacheFileScale, 0, 0);
} catch (Throwable t) {
throw Error.error(t, ErrorCode.FILE_IO_ERROR,
ErrorCode.M_TextCache_openning_file_error,
new Object[] {
t.toString(), dataFileName
});
}
cacheReadonly = readonly;
}
示例14: 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
});
}
}
示例15: open
import org.hsqldb.DatabaseURL; //导入依赖的package包/类
public void open() {
lobBlockSize = database.logger.getLobBlockSize();
if (database.getType() == DatabaseURL.S_RES) {
lobStore = new LobStoreInJar(database, lobBlockSize);
} else if (database.getType() == DatabaseURL.S_FILE) {
lobStore = new LobStoreRAFile(database, lobBlockSize);
byteBuffer = new byte[lobBlockSize];
} else {
lobStore = new LobStoreMem(lobBlockSize);
byteBuffer = new byte[lobBlockSize];
}
}