本文整理汇总了Java中org.hsqldb.persist.HsqlProperties.removeProperty方法的典型用法代码示例。如果您正苦于以下问题:Java HsqlProperties.removeProperty方法的具体用法?Java HsqlProperties.removeProperty怎么用?Java HsqlProperties.removeProperty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.hsqldb.persist.HsqlProperties
的用法示例。
在下文中一共展示了HsqlProperties.removeProperty方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: translateDefaultDatabaseProperty
import org.hsqldb.persist.HsqlProperties; //导入方法依赖的package包/类
/**
* Translates the legacy default database form: database=...
* to the 1.7.2 form: database.0=...
*
* @param p The properties object upon which to perform the translation
*/
public static void translateDefaultDatabaseProperty(HsqlProperties p) {
if (p == null) {
return;
}
if (!p.isPropertyTrue(ServerProperties.sc_key_remote_open_db)) {
if (p.getProperty(ServerProperties.sc_key_database + "." + 0)
== null) {
String defaultdb =
p.getProperty(ServerProperties.sc_key_database);
if (defaultdb == null) {
defaultdb = SC_DEFAULT_DATABASE;
} else {
p.removeProperty(ServerProperties.sc_key_database);
}
p.setProperty(ServerProperties.sc_key_database + ".0",
defaultdb);
p.setProperty(ServerProperties.sc_key_dbname + ".0", "");
}
if (p.getProperty(ServerProperties.sc_key_dbname + "." + 0)
== null) {
p.setProperty(ServerProperties.sc_key_dbname + ".0", "");
}
}
}
示例2: main
import org.hsqldb.persist.HsqlProperties; //导入方法依赖的package包/类
/**
* Creates and starts a new Server. <p>
*
* Allows starting a Server via the command line interface. <p>
*
* @param args the command line arguments for the Server instance
*/
public static void main(String[] args) {
HsqlProperties argProps = null;
argProps = HsqlProperties.argArrayToProps(args,
ServerProperties.sc_key_prefix);
String[] errors = argProps.getErrorKeys();
if (errors.length != 0) {
System.out.println("no value for argument:" + errors[0]);
printHelp("server.help");
return;
}
String propsPath = argProps.getProperty(ServerProperties.sc_key_props);
String propsExtension = "";
if (propsPath == null) {
propsPath = "server";
propsExtension = ".properties";
} else {
argProps.removeProperty(ServerProperties.sc_key_props);
}
propsPath = FileUtil.getFileUtil().canonicalOrAbsolutePath(propsPath);
ServerProperties fileProps = ServerConfiguration.getPropertiesFromFile(
ServerConstants.SC_PROTOCOL_HSQL, propsPath, propsExtension);
ServerProperties props =
fileProps == null
? new ServerProperties(ServerConstants.SC_PROTOCOL_HSQL)
: fileProps;
props.addProperties(argProps);
ServerConfiguration.translateDefaultDatabaseProperty(props);
// Standard behaviour when started from the command line
// is to halt the VM when the server shuts down. This may, of
// course, be overridden by whatever, if any, security policy
// is in place.
ServerConfiguration.translateDefaultNoSystemExitProperty(props);
ServerConfiguration.translateAddressProperty(props);
// finished setting up properties;
Server server = new Server();
try {
server.setProperties(props);
} catch (Exception e) {
server.printError("Failed to set properties");
server.printStackTrace(e);
return;
}
// now messages go to the channel specified in properties
server.print("Startup sequence initiated from main() method");
if (fileProps != null) {
server.print("Loaded properties from [" + propsPath
+ propsExtension + "]");
} else {
server.print("Could not load properties from file");
server.print("Using cli/default properties only");
}
server.start();
}