Examples of HsqlDatabaseProperties


Examples of org.hsqldb.persist.HsqlDatabaseProperties

        token = tokenizer.getSimpleToken();

        switch (Token.get(token)) {

            case Token.PROPERTY : {
                HsqlDatabaseProperties p;

                session.checkAdmin();

                token = tokenizer.getSimpleName();

                if (!tokenizer.wasQuotedIdentifier()) {
                    throw Trace.error(Trace.QUOTED_IDENTIFIER_REQUIRED);
                }

                p = database.getProperties();

                boolean isboolean  = p.isBoolean(token);
                boolean isintegral = p.isIntegral(token);
                boolean isstring   = p.isString(token);

                Trace.check(isboolean || isintegral || isstring,
                            Trace.ACCESS_IS_DENIED, token);

                int    type  = isboolean ? Types.BOOLEAN
                                         : isintegral ? Types.INTEGER
                                                      : Types.VARCHAR;
                Object value = tokenizer.getInType(type);

                if (HsqlDatabaseProperties.hsqldb_cache_file_scale.equals(
                        token)) {
                    if (database.logger.hasCache()
                            || ((Integer) value).intValue() != 8) {
                        Trace.throwerror(Trace.ACCESS_IS_DENIED, token);
                    }
                }

                p.setDatabaseProperty(token, value.toString().toLowerCase());
                p.setDatabaseVariables();

                break;
            }
            case Token.SCHEMA : {
                session.setScripting(false);
View Full Code Here

Examples of org.hsqldb.persist.HsqlDatabaseProperties

        boolean isNew;

        setState(DATABASE_OPENING);

        try {
            databaseProperties = new HsqlDatabaseProperties(this);
            isNew = !DatabaseURL.isFileBasedDatabaseType(sType)
                    || !databaseProperties.checkFileExists();

            if (isNew && urlProperties.isPropertyTrue("ifexists")) {
                throw Trace.error(Trace.DATABASE_NOT_EXISTS, sName);
View Full Code Here

Examples of org.hsqldb.persist.HsqlDatabaseProperties

        String scope;
        String nameSpace;

        // intermediate holders
        Object[]               row;
        HsqlDatabaseProperties props;

        // First, we want the names and values for
        // all JDBC capabilities constants
        scope     = "SESSION";
        props     = database.getProperties();
        nameSpace = "database.properties";

        // boolean properties
        Iterator it = props.getUserDefinedPropertyData().iterator();

        while (it.hasNext()) {
            Object[] metaData = (Object[]) it.next();

            row         = t.getEmptyRowData();
            row[iscope] = scope;
            row[ins]    = nameSpace;
            row[iname= metaData[HsqlProperties.indexName];
            row[ivalue] = props.getProperty((String) row[iname]);
            row[iclass] = metaData[HsqlProperties.indexClass];

            t.insertSys(store, row);
        }
View Full Code Here

Examples of org.hsqldb.persist.HsqlDatabaseProperties

        read();

        String                 property;
        Object                 value;
        HsqlDatabaseProperties props;

        checkIsSimpleName();
        checkIsDelimitedIdentifier();

        property = token.tokenString;
        props    = database.getProperties();

        boolean isboolean  = props.isBoolean(token.tokenString);
        boolean isintegral = props.isIntegral(token.tokenString);
        boolean isstring   = props.isString(token.tokenString);

        if (!(isboolean || isintegral || isstring)) {
            throw Error.error(ErrorCode.X_42511);
        }
View Full Code Here

Examples of org.hsqldb.persist.HsqlDatabaseProperties

                            return Result.newErrorResult(e, sql);
                        }
                    }

                    HsqlDatabaseProperties p =
                        session.database.getProperties();

                    p.setDatabaseProperty(property,
                                          value.toString().toLowerCase());
                    p.setDatabaseVariables();
                    p.save();

                    return Result.updateZeroResult;
                } catch (HsqlException e) {
                    return Result.newErrorResult(e, sql);
                }
View Full Code Here

Examples of org.hsqldb.persist.HsqlDatabaseProperties

        boolean isNew;

        setState(DATABASE_OPENING);

        try {
            databaseProperties = new HsqlDatabaseProperties(this);
            isNew = !DatabaseURL.isFileBasedDatabaseType(databaseType)
                    || !databaseProperties.checkFileExists();

            if (isNew && urlProperties.isPropertyTrue(
                    HsqlDatabaseProperties.url_ifexists)) {
View Full Code Here

Examples of org.hsqldb.persist.HsqlDatabaseProperties

        boolean isNew;

        setState(DATABASE_OPENING);

        try {
            databaseProperties = new HsqlDatabaseProperties(this);
            isNew = !DatabaseURL.isFileBasedDatabaseType(sType)
                    ||!databaseProperties.checkFileExists();

            if (isNew && urlProperties.isPropertyTrue("ifexists")) {
                throw Trace.error(Trace.DATABASE_NOT_EXISTS, sName);
View Full Code Here

Examples of org.hsqldb.persist.HsqlDatabaseProperties

        String scope;
        String nameSpace;

        // intermediate holders
        Object[]               row;
        HsqlDatabaseProperties props;

        // column number mappings
        final int iscope = 0;
        final int ins    = 1;
        final int iname  = 2;
        final int ivalue = 3;
        final int iclass = 4;

        // First, we want the names and values for
        // all JDBC capabilities constants
        scope     = "SESSION";
        props     = database.getProperties();
        nameSpace = "database.properties";

        // boolean properties
        Iterator it = props.getUserDefinedPropertyData().iterator();

        while (it.hasNext()) {
            Object[] metaData = (Object[]) it.next();

            row         = t.getEmptyRowData();
            row[iscope] = scope;
            row[ins]    = nameSpace;
            row[iname= metaData[HsqlDatabaseProperties.indexName];
            row[ivalue] = props.getProperty((String) row[iname]);
            row[iclass] = metaData[HsqlDatabaseProperties.indexClass];

            t.insertSys(row);
        }
View Full Code Here

Examples of org.hsqldb.persist.HsqlDatabaseProperties

        token = tokenizer.getSimpleToken();

        switch (Token.get(token)) {

            case Token.PROPERTY : {
                HsqlDatabaseProperties p;

                session.checkAdmin();

                token = tokenizer.getSimpleName();

                if (!tokenizer.wasQuotedIdentifier()) {
                    throw Trace.error(Trace.QUOTED_IDENTIFIER_REQUIRED);
                }

                p = database.getProperties();

                Trace.check(p.isSetPropertyAllowed(token),
                            Trace.ACCESS_IS_DENIED, token);

                boolean isboolean  = p.isBoolean(token);
                boolean isintegral = p.isIntegral(token);
                boolean isstring   = p.isString(token);

                Trace.check(isboolean || isintegral || isstring,
                            Trace.ACCESS_IS_DENIED, token);

                int    type  = isboolean ? Types.BOOLEAN
                                         : isintegral ? Types.INTEGER
                                                      : Types.VARCHAR;
                Object value = tokenizer.getInType(type);

                if (HsqlDatabaseProperties.hsqldb_cache_file_scale.equals(
                        token)) {
                    if (database.logger.hasCache()
                            || ((Integer) value).intValue() != 8) {
                        Trace.throwerror(Trace.ACCESS_IS_DENIED, token);
                    }
                }

                p.setProperty(token, value.toString().toLowerCase());
                p.setDatabaseVariables();

                break;
            }
            case Token.SCHEMA : {
                session.setScripting(false);
View Full Code Here

Examples of org.hsqldb.persist.HsqlDatabaseProperties

        String scope;
        String nameSpace;

        // intermediate holders
        Object[]               row;
        HsqlDatabaseProperties props;

        // column number mappings
        final int iscope = 0;
        final int ins    = 1;
        final int iname  = 2;
        final int ivalue = 3;
        final int iclass = 4;

        // First, we want the names and values for
        // all JDBC capabilities constants
        scope     = "SESSION";
        props     = database.getProperties();
        nameSpace = "database.properties";

        // boolean properties
        Iterator it = props.getBooleanPropertyNames().iterator();

        while (it.hasNext()) {
            String name = (String) it.next();

            row         = t.getEmptyRowData();
            row[iscope] = scope;
            row[ins]    = nameSpace;
            row[iname= name;
            row[ivalue] = props.getProperty(name, "false");
            row[iclass] = "boolean";

            t.insertSys(row);
        }

        // integral properties
        it = props.getIntegralPropertyNames().iterator();

        while (it.hasNext()) {
            String name = (String) it.next();

            row         = t.getEmptyRowData();
            row[iscope] = scope;
            row[ins]    = nameSpace;
            row[iname= name;
            row[ivalue] = props.getProperty(name, "0");
            row[iclass] = "int";

            t.insertSys(row);
        }

        // string properties
        it = props.getStringPropertyNames().iterator();

        while (it.hasNext()) {
            String name = (String) it.next();

            row         = t.getEmptyRowData();
            row[iscope] = scope;
            row[ins]    = nameSpace;
            row[iname= name;
            row[ivalue] = props.getProperty(name, "");
            row[iclass] = "java.lang.String";

            t.insertSys(row);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.