Package org.hsqldb.persist

Examples of org.hsqldb.persist.HsqlProperties


        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) {
                errorStr = e.getMessage();
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

                                + dbNumberMap.get(dbNumber));

                continue;
            }

            HsqlProperties dbURL = DatabaseURL.parseURL(path, false, false);

            if (dbURL == null) {
                printWithThread("malformed database path: " + path);

                continue;
            }

            dbAlias[i] = (String) dbNumberMap.get(dbNumber);
            dbPath[i= dbURL.getProperty("database");
            dbType[i= dbURL.getProperty("connection_type");
            dbProps[i] = dbURL;

            i++;
        }
    }
View Full Code Here

     *
     * @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(
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

  // Facilitate test cases
  protected HsqlProperties getServerProperties( String[] args ) {
    // From HSQLDB Server.java main method...
    String propsPath = FileUtil.canonicalOrAbsolutePath( "server" ); //$NON-NLS-1$
    HsqlProperties fileProps = ServerConfiguration.getPropertiesFromFile( propsPath );
    HsqlProperties props = fileProps == null ? new HsqlProperties() : fileProps;
    HsqlProperties stringProps = null;
    try {
      stringProps = HsqlProperties.argArrayToProps( args, ServerConstants.SC_KEY_PREFIX );
      props.addProperties( stringProps );
    } catch ( ArrayIndexOutOfBoundsException ex ) {
      logger.error( Messages.getErrorString( "HsqlDatabaseStarterBean.ERROR_0001_INVALID_PARAMETERS" ) ); //$NON-NLS-1$
View Full Code Here

      for ( int i = 0; i < args.length; i++ ) {
        logger.trace( String.format( "  args[%d]=%s", i, args[i] ) ); //$NON-NLS-1$
      }
    }

    HsqlProperties props = getServerProperties( args );
    if ( props == null ) { // If props failed, return
      return false;
    }

    hsqlServer = getNewHSQLDBServer();
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.