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


Java HsqlProperties.addProperties方法代码示例

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


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

示例1: getConnection

import org.hsqldb.persist.HsqlProperties; //导入方法依赖的package包/类
public static Connection getConnection(String url,
                                       Properties info)
                                       throws SQLException {

    HsqlProperties props = DatabaseURL.parseURL(url, true);

    if (props == null) {

        // supposed to be an HSQLDB driver url but has errors
        throw new SQLException(
            Trace.getMessage(Trace.INVALID_JDBC_ARGUMENT));
    } else if (props.isEmpty()) {

        // is not an HSQLDB driver url
        return null;
    }

    props.addProperties(info);

    return new jdbcConnection(props);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:22,代码来源:jdbcDriver.java

示例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) {

    String propsPath =
        FileUtil.getDefaultInstance().canonicalOrAbsolutePath("server");
    HsqlProperties fileProps =
        ServerConfiguration.getPropertiesFromFile(propsPath);
    HsqlProperties props       = fileProps == null ? new HsqlProperties()
                                                   : fileProps;
    HsqlProperties stringProps = null;

    try {
        stringProps = HsqlProperties.argArrayToProps(args,
                ServerConstants.SC_KEY_PREFIX);
    } catch (ArrayIndexOutOfBoundsException aioob) {

        // I'd like to exit with 0 here, but it's possible that user
        // has called main() programmatically and does not want us to
        // exit.
        printHelp("server.help");

        return;
    }

    if (stringProps != null) {
        if (stringProps.getErrorKeys().length != 0) {
            printHelp("server.help");

            return;
        }

        props.addProperties(stringProps);
    }

    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);

    // 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
                     + ".properties]");
    } else {
        server.print("Could not load properties from file");
        server.print("Using cli/default properties only");
    }

    server.start();
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:74,代码来源:Server.java

示例3: main

import org.hsqldb.persist.HsqlProperties; //导入方法依赖的package包/类
/**
 *  Starts a new WebServer.
 *
 * @param  args the "command line" parameters with which to start
 *      the WebServer.  "-?" will cause the command line arguments
 *      help to be printed to the standard output
 */
public static void main(String[] args) {

    String propsPath =
        FileUtil.getDefaultInstance().canonicalOrAbsolutePath("webserver");
    HsqlProperties fileProps =
        ServerConfiguration.getPropertiesFromFile(propsPath);
    HsqlProperties props = fileProps == null ? new HsqlProperties()
                                             : fileProps;
    HsqlProperties stringProps = null;
    try {
        stringProps = HsqlProperties.argArrayToProps(args,
                ServerConstants.SC_KEY_PREFIX);
    } catch (ArrayIndexOutOfBoundsException aioob) {
        // I'd like to exit with 0 here, but it's possible that user
        // has called main() programmatically and does not want us to
        // exit.
        printHelp("webserver.help");
        return;
    }

    if (stringProps != null) {
        if (stringProps.getErrorKeys().length != 0) {
            printHelp("webserver.help");

            return;
        }

        props.addProperties(stringProps);
    }

    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);

    // finished setting up properties;
    Server server = new WebServer();

    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
                     + ".properties]");
    } else {
        server.print("Could not load properties from file");
        server.print("Using cli/default properties only");
    }

    server.start();
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:71,代码来源:WebServer.java


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