Package org.hsqldb.persist

Examples of org.hsqldb.persist.HsqlProperties


        _hsqlServer.setTls(false);
        _hsqlServer.setLogWriter(new PrintWriter(System.out));
        _hsqlServer.setErrWriter(new PrintWriter(System.out));
        _hsqlServer.setAddress(null);
       
        HsqlProperties hsqlProps = new HsqlProperties();
        hsqlProps.setProperty(ServerConstants.SC_KEY_REMOTE_OPEN_DB, true);
        _hsqlServer.setProperties(hsqlProps);
       
        _hsqlServer.setDatabasePath(0, hsqlPath);
        _hsqlServer.setDatabaseName(0, "");
       
View Full Code Here


            // add the silent property
            properties.setProperty(sc_key_silent, "true");
            // set the log and error writers
            server.setLogWriter(new HsqlPrintWriter(false));
            server.setErrWriter(new HsqlPrintWriter(true));
            server.setProperties(new HsqlProperties(properties));

            // get the port
            port = server.getPort();

            // get the Address
View Full Code Here

//#endif JAVA6
    public static Connection getConnection(String url,
            Properties info) throws SQLException {

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

        if (props == null) {

            // supposed to be an HSQLDB driver url but has errors
            throw Util.invalidArgument();
        } else if (props.isEmpty()) {

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

        long timeout = 0;

        if (info != null && info.containsKey("loginTimeout")) {
            String loginTimeoutProperty = info.getProperty("loginTimeout");

            if (loginTimeoutProperty != null) {
                loginTimeoutProperty = loginTimeoutProperty.trim();

                if (loginTimeoutProperty.length() > 0) {
                    try {
                        timeout = Integer.parseInt(loginTimeoutProperty);
                    } catch (NumberFormatException nfe) {
                    }
                }
            }
        }
        props.addProperties(info);

        if (timeout == 0) {
            timeout = DriverManager.getLoginTimeout();
        }

        // @todo:  maybe impose some sort of sane restriction
        //         on network connections regarless of user
        //         specification?
        if (timeout == 0) {

            // no timeout restriction
            return new JDBCConnection(props);
        }

        String connType = props.getProperty("connection_type");

        if (DatabaseURL.isInProcessDatabaseType(connType)) {
            return new JDBCConnection(props);
        }
View Full Code Here

        Iterator       tables;
        Table          table;
        DITableInfo    ti;
        int[]          cols;
        Object[]       row;
        HsqlProperties p;

        // Column number mappings
        final int iscope          = 0;
        final int icolumn_name    = 1;
        final int idata_type      = 2;
View Full Code Here

        Table          table;
        Object[]       row;
        Constraint     constraint;
        int[]          cols;
        int            colCount;
        HsqlProperties p;

        // column number mappings
        final int itable_cat   = 0;
        final int itable_schem = 1;
        final int itable_name  = 2;
View Full Code Here

     *      the WebServer.  "-?" will cause the command line arguments
     *      help to be printed to the standard output
     */
    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("webserver.help");

            return;
        }

        String propsPath = argProps.getProperty(ServerProperties.sc_key_props);
        String propsExtension = "";

        if (propsPath == null) {
            propsPath      = "webserver";
            propsExtension = ".properties";
View Full Code Here

        if (!dbStr.equals(".") && "true".equalsIgnoreCase(useWebInfStr)) {
            dbStr = getServletContext().getRealPath("/") + "WEB-INF/" + dbStr;
        }

// end WEB-INF patch
        HsqlProperties dbURL = DatabaseURL.parseURL(dbStr, false, false);

        log("Database filename = " + dbStr);

        if (dbURL == null) {
            errorStr = "Bad Database name";
        } else {
            dbPath = dbURL.getProperty("database");
            dbType = dbURL.getProperty("connection_type");

            try {

                DatabaseManager.getDatabase(dbType, dbPath, dbURL);
            } catch (HsqlException e) {
View Full Code Here

                if (resultIn.getType() == ResultConstants.CONNECT) {
                    try {
                        session = DatabaseManager.newSession(
                            dbType, dbPath, resultIn.getMainString(),
                            resultIn.getSubString(), new HsqlProperties(),
                            resultIn.getZoneString(),
                            resultIn.getUpdateCount());

                        resultIn.readAdditionalResults(null, inStream, rowIn);
View Full Code Here

            return;
        }

        printWithThread("putPropertiesFromString(): [" + s + "]");

        HsqlProperties p = HsqlProperties.delimitedArgPairsToProps(s, "=",
            ";", ServerProperties.sc_key_prefix);

        try {
            setProperties(p);
        } catch (Exception e) {
View Full Code Here

                throw e;
            }
        }

        HsqlProperties newprops = DatabaseURL.parseURL(datapath, false, false);

        if (newprops == null) {
            HsqlException e = Error.error(ErrorCode.GENERAL_ERROR,
                                          "invalid database path");

            printError("invalid database path");
            setServerError(e);

            throw e;
        }

        String path = newprops.getProperty(DatabaseURL.url_database);
        String type = newprops.getProperty(DatabaseURL.url_connection_type);

        try {
            int dbid = DatabaseManager.getDatabase(type, path, this, newprops);

            dbID[i]             = dbid;
View Full Code Here

TOP

Related Classes of org.hsqldb.persist.HsqlProperties

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.