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


Java DatabaseURL.S_HSQL属性代码示例

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


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

示例1: jdbcConnection

/**
     * Constructs a new external <code>Connection</code> to an HSQLDB
     * <code>Database</code>. <p>
     *
     * This constructor is called on behalf of the
     * <code>java.sql.DriverManager</code> when getting a
     * <code>Connection</code> for use in normal (external)
     * client code. <p>
     *
     * Internal client code, that being code located in HSQLDB SQL
     * functions and stored procedures, receives an INTERNAL
     * connection constructed by the {@link #jdbcConnection(Session)
     * jdbcConnection(Session)} constructor. <p>
     *
     * @param props A <code>Properties</code> object containing the connection
     *      properties
     * @exception SQLException when the user/password combination is
     *     invalid, the connection url is invalid, or the
     *     <code>Database</code> is unavailable. <p>
     *
     *     The <code>Database</code> may be unavailable for a number
     *     of reasons, including network problems or the fact that it
     *     may already be in use by another process.
     */
    public jdbcConnection(HsqlProperties props) throws SQLException {

        String user     = props.getProperty("user");
        String password = props.getProperty("password");
        String connType = props.getProperty("connection_type");
        String host     = props.getProperty("host");
        int    port     = props.getIntegerProperty("port", 0);
        String path     = props.getProperty("path");
        String database = props.getProperty("database");
        boolean isTLS = (connType == DatabaseURL.S_HSQLS
                         || connType == DatabaseURL.S_HTTPS);

        if (user == null) {
            user = "SA";
        }

        if (password == null) {
            password = "";
        }

        user     = user.toUpperCase(Locale.ENGLISH);
        password = password.toUpperCase(Locale.ENGLISH);

        try {
            if (DatabaseURL.isInProcessDatabaseType(connType)) {

/** @todo fredt - this should be the only static reference to a core class in
                     *  the jdbc package - we may make it dynamic */
                sessionProxy = DatabaseManager.newSession(connType, database,
                        user, password, props);
            } else if (connType == DatabaseURL.S_HSQL
                       || connType == DatabaseURL.S_HSQLS) {
                sessionProxy = new HSQLClientConnection(host, port, path,
                        database, isTLS, user, password);
                isNetConn = true;
            } else if (connType == DatabaseURL.S_HTTP
                       || connType == DatabaseURL.S_HTTPS) {
                sessionProxy = new HTTPClientConnection(host, port, path,
                        database, isTLS, user, password);
                isNetConn = true;
            } else {    // alias: type not yet implemented
                throw Util.sqlException(Trace.INVALID_JDBC_ARGUMENT);
            }

            connProperties = props;
        } catch (HsqlException e) {
            throw Util.sqlException(e);
        }
    }
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:73,代码来源:jdbcConnection.java


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