• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java SchemaObject类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: createFirstUser

import org.hsqldb.SchemaObject; //导入依赖的package包/类
public void createFirstUser(String username, String password) {

        boolean isQuoted = true;

        if (username.equalsIgnoreCase("SA")) {
            username = "SA";
            isQuoted = false;
        }

        HsqlName name =
            granteeManager.database.nameManager.newHsqlName(username,
                isQuoted, SchemaObject.GRANTEE);
        User user = createUser(null, name, password, false);

        user.isLocalOnly = true;

        granteeManager.grant(name.name, SqlInvariants.DBA_ADMIN_ROLE_NAME,
                             granteeManager.getDBARole());
    }
 
开发者ID:Julien35,项目名称:dev-courses,代码行数:20,代码来源:UserManager.java


示例2: checkUpdate

import org.hsqldb.SchemaObject; //导入依赖的package包/类
public void checkUpdate(SchemaObject object, boolean[] checkList) {

        if (object instanceof Table) {
            Table table = (Table) object;

            if (isFullyAccessibleByRole(table.getName())) {
                return;
            }

            Right right = (Right) fullRightsMap.get(table.getName());

            if (right != null && right.canUpdate(table, checkList)) {
                return;
            }
        }

        throw Error.error(ErrorCode.X_42501, object.getName().name);
    }
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:19,代码来源:Grantee.java


示例3: checkReferences

import org.hsqldb.SchemaObject; //导入依赖的package包/类
public void checkReferences(SchemaObject object, boolean[] checkList) {

        if (object instanceof Table) {
            Table table = (Table) object;

            if (isFullyAccessibleByRole(table.getName())) {
                return;
            }

            Right right = (Right) fullRightsMap.get(table.getName());

            if (right != null && right.canReference(table, checkList)) {
                return;
            }
        }

        throw Error.error(ErrorCode.X_42501, object.getName().name);
    }
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:19,代码来源:Grantee.java


示例4: checkTrigger

import org.hsqldb.SchemaObject; //导入依赖的package包/类
public void checkTrigger(SchemaObject object, boolean[] checkList) {

        if (object instanceof Table) {
            Table table = (Table) object;

            if (isFullyAccessibleByRole(table.getName())) {
                return;
            }

            Right right = (Right) fullRightsMap.get(table.getName());

            if (right != null && right.canReference(table, checkList)) {
                return;
            }
        }

        throw Error.error(ErrorCode.X_42501, object.getName().name);
    }
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:19,代码来源:Grantee.java


示例5: Collation

import org.hsqldb.SchemaObject; //导入依赖的package包/类
private Collation(String name, String language, String country,
                  int strength, int decomposition, boolean ucc) {

    locale   = new Locale(language, country);
    collator = Collator.getInstance(locale);

    if (strength >= 0) {
        collator.setStrength(strength);
    }

    if (decomposition >= 0) {
        collator.setDecomposition(decomposition);
    }

    strength        = collator.getStrength();
    isUnicodeSimple = false;
    this.name = HsqlNameManager.newInfoSchemaObjectName(name, true,
            SchemaObject.COLLATION);
    charset            = Charset.SQL_TEXT;
    isUpperCaseCompare = ucc;
    isFinal            = true;
}
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:23,代码来源:Collation.java


示例6: checkSelect

import org.hsqldb.SchemaObject; //导入依赖的package包/类
/**
 * Checks if a right represented by the methods
 * have been granted on the specified database object. <p>
 *
 * This is done by checking that a mapping exists in the rights map
 * from the dbobject argument. Otherwise, it throws.
 */
public void checkSelect(SchemaObject object, boolean[] checkList) {

    if (object instanceof Table) {
        Table table = (Table) object;

        if (isFullyAccessibleByRole(table.getName())) {
            return;
        }

        Right right = (Right) fullRightsMap.get(table.getName());

        if (right != null && right.canSelect(table, checkList)) {
            return;
        }
    }

    throw Error.error(ErrorCode.X_42501, object.getName().name);
}
 
开发者ID:Julien35,项目名称:dev-courses,代码行数:26,代码来源:Grantee.java


示例7: grant

import org.hsqldb.SchemaObject; //导入依赖的package包/类
/**
 * Grants the rights represented by the rights argument on
 * the database object identified by the dbobject argument
 * to the Grantee object identified by name argument.<p>
 *
 *  Note: For the dbobject argument, Java Class objects are identified
 *  using a String object whose value is the fully qualified name
 *  of the Class, while Table and other objects are
 *  identified by an HsqlName object.  A Table
 *  object identifier must be precisely the one obtained by calling
 *  table.getName(); if a different HsqlName
 *  object with an identical name attribute is specified, then
 *  rights checks and tests will fail, since the HsqlName
 *  class implements its {@link HsqlName#hashCode hashCode} and
 *  {@link HsqlName#equals equals} methods based on pure object
 *  identity, rather than on attribute values. <p>
 */
public void grant(OrderedHashSet granteeList, SchemaObject dbObject,
                  Right right, Grantee grantor, boolean withGrantOption) {

    if (!grantor.isGrantable(dbObject, right)) {
        throw Error.error(ErrorCode.X_0L000, grantor.getNameString());
    }

    if (grantor.isAdmin()) {
        grantor = dbObject.getOwner();
    }

    checkGranteeList(granteeList);

    for (int i = 0; i < granteeList.size(); i++) {
        String  name    = (String) granteeList.get(i);
        Grantee grantee = get(name);

        grantee.grant(dbObject, right, grantor, withGrantOption);

        if (grantee.isRole) {
            updateAllRights(grantee);
        }
    }
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:42,代码来源:GranteeManager.java


示例8: SQL_PARTS

import org.hsqldb.SchemaObject; //导入依赖的package包/类
Table SQL_PARTS() {

        Table t = sysTables[SQL_PARTS];

        if (t == null) {
            t = createBlankTable(sysTableHsqlNames[SQL_PARTS]);

            addColumn(t, "PART", CHARACTER_DATA);
            addColumn(t, "NAME", CHARACTER_DATA);
            addColumn(t, "IS_SUPPORTED", YES_OR_NO);
            addColumn(t, "IS_VERIFIED_BY", CHARACTER_DATA);
            addColumn(t, "COMMENTS", CHARACTER_DATA);

            HsqlName name = HsqlNameManager.newInfoSchemaObjectName(
                sysTableHsqlNames[SQL_PARTS].name, false, SchemaObject.INDEX);

            t.createPrimaryKey(name, new int[]{ 0 }, false);

            return t;
        }

        PersistentStore store = database.persistentStoreCollection.getStore(t);
        Session sys = database.sessionManager.newSysSession(
            SqlInvariants.INFORMATION_SCHEMA_HSQLNAME, session.getUser());
        String sql = (String) statementMap.get("/*sql_parts*/");
        Result rs = sys.executeDirectStatement(sql);


        t.insertSys(store, rs);

        return t;
    }
 
开发者ID:s-store,项目名称:s-store,代码行数:33,代码来源:DatabaseInformationFull.java


示例9: GranteeManager

import org.hsqldb.SchemaObject; //导入依赖的package包/类
/**
     * Construct the GranteeManager for a Database. Construct special Grantee
     * objects for _SYSTEM, PUBLIC and DBA, and add them to the Grantee map.
     *
     * @param database Only needed to link to the RoleManager later on.
     */
    public GranteeManager(Database database) {

        this.database = database;

//        map.add(systemAuthorisation.getNameString(), systemAuthorisation);
//        roleMap.add(systemAuthorisation.getNameString(), systemAuthorisation);
        addRole(
            this.database.nameManager.newHsqlName(
                SqlInvariants.PUBLIC_ROLE_NAME, false, SchemaObject.GRANTEE));

        publicRole          = getRole(SqlInvariants.PUBLIC_ROLE_NAME);
        publicRole.isPublic = true;

        addRole(
            this.database.nameManager.newHsqlName(
                SqlInvariants.DBA_ADMIN_ROLE_NAME, false,
                SchemaObject.GRANTEE));

        dbaRole = getRole(SqlInvariants.DBA_ADMIN_ROLE_NAME);

        dbaRole.setAdminDirect();
        addRole(
            this.database.nameManager.newHsqlName(
                SqlInvariants.SCHEMA_CREATE_ROLE_NAME, false,
                SchemaObject.GRANTEE));

        schemaRole = getRole(SqlInvariants.SCHEMA_CREATE_ROLE_NAME);

        addRole(
            this.database.nameManager.newHsqlName(
                SqlInvariants.CHANGE_AUTH_ROLE_NAME, false,
                SchemaObject.GRANTEE));

        changeAuthRole = getRole(SqlInvariants.CHANGE_AUTH_ROLE_NAME);
    }
 
开发者ID:Julien35,项目名称:dev-courses,代码行数:42,代码来源:GranteeManager.java


示例10: grant

import org.hsqldb.SchemaObject; //导入依赖的package包/类
/**
 * Grants the rights represented by the rights argument on
 * the database object identified by the dbobject argument
 * to the Grantee object identified by name argument.<p>
 *
 *  Note: For the dbobject argument, Java Class objects are identified
 *  using a String object whose value is the fully qualified name
 *  of the Class, while Table and other objects are
 *  identified by an HsqlName object.  A Table
 *  object identifier must be precisely the one obtained by calling
 *  table.getName(); if a different HsqlName
 *  object with an identical name attribute is specified, then
 *  rights checks and tests will fail, since the HsqlName
 *  class implements its {@link HsqlName#hashCode hashCode} and
 *  {@link HsqlName#equals equals} methods based on pure object
 *  identity, rather than on attribute values. <p>
 */
public void grant(OrderedHashSet granteeList, SchemaObject dbObject,
                  Right right, Grantee grantor, boolean withGrantOption) {

    if (dbObject instanceof RoutineSchema) {
        SchemaObject[] routines =
            ((RoutineSchema) dbObject).getSpecificRoutines();

        grant(granteeList, routines, right, grantor, withGrantOption);

        return;
    }

    HsqlName name = dbObject.getName();

    if (dbObject instanceof Routine) {
        name = ((Routine) dbObject).getSpecificName();
    }

    if (!grantor.isGrantable(dbObject, right)) {
        throw Error.error(ErrorCode.X_0L000,
                          grantor.getName().getNameString());
    }

    if (grantor.isAdmin()) {
        grantor = dbObject.getOwner();
    }

    checkGranteeList(granteeList);

    for (int i = 0; i < granteeList.size(); i++) {
        Grantee grantee = get((String) granteeList.get(i));

        grantee.grant(name, right, grantor, withGrantOption);

        if (grantee.isRole) {
            updateAllRights(grantee);
        }
    }
}
 
开发者ID:Julien35,项目名称:dev-courses,代码行数:57,代码来源:GranteeManager.java


示例11: SYSTEM_VERSIONCOLUMNS

import org.hsqldb.SchemaObject; //导入依赖的package包/类
/**
 * Retrieves a <code>Table</code> object describing the accessible
 * columns that are automatically updated when any value in a row
 * is updated. <p>
 *
 * Each row is a version column description with the following columns: <p>
 *
 * <OL>
 * <LI><B>SCOPE</B> <code>SMALLINT</code> => is not used
 * <LI><B>COLUMN_NAME</B> <code>VARCHAR</code> => column name
 * <LI><B>DATA_TYPE</B> <code>SMALLINT</code> =>
 *        SQL data type from java.sql.Types
 * <LI><B>TYPE_NAME</B> <code>SMALLINT</code> =>
 *       Data source dependent type name
 * <LI><B>COLUMN_SIZE</B> <code>INTEGER</code> => precision
 * <LI><B>BUFFER_LENGTH</B> <code>INTEGER</code> =>
 *        length of column value in bytes
 * <LI><B>DECIMAL_DIGITS</B> <code>SMALLINT</code> => scale
 * <LI><B>PSEUDO_COLUMN</B> <code>SMALLINT</code> =>
 *        is this a pseudo column like an Oracle <code>ROWID</code>:<BR>
 *        (as defined in <code>java.sql.DatabaseMetadata</code>)
 * <UL>
 *    <LI><code>versionColumnUnknown</code> - may or may not be
 *        pseudo column
 *    <LI><code>versionColumnNotPseudo</code> - is NOT a pseudo column
 *    <LI><code>versionColumnPseudo</code> - is a pseudo column
 * </UL>
 * </OL> <p>
 *
 * <B>Note:</B> Currently, the HSQLDB engine does not support version
 * columns, so an empty table is returned. <p>
 *
 * @return a <code>Table</code> object describing the columns
 *        that are automatically updated when any value
 *        in a row is updated
 */
Table SYSTEM_VERSIONCOLUMNS(Session session, PersistentStore store) {

    Table t = sysTables[SYSTEM_VERSIONCOLUMNS];

    if (t == null) {
        t = createBlankTable(sysTableHsqlNames[SYSTEM_VERSIONCOLUMNS]);

        // ----------------------------------------------------------------
        // required by DatabaseMetaData.getVersionColumns result set
        // ----------------------------------------------------------------
        addColumn(t, "SCOPE", Type.SQL_INTEGER);
        addColumn(t, "COLUMN_NAME", SQL_IDENTIFIER);         // not null
        addColumn(t, "DATA_TYPE", Type.SQL_SMALLINT);        // not null
        addColumn(t, "TYPE_NAME", SQL_IDENTIFIER);           // not null
        addColumn(t, "COLUMN_SIZE", Type.SQL_SMALLINT);
        addColumn(t, "BUFFER_LENGTH", Type.SQL_INTEGER);
        addColumn(t, "DECIMAL_DIGITS", Type.SQL_SMALLINT);
        addColumn(t, "PSEUDO_COLUMN", Type.SQL_SMALLINT);    // not null

        // -----------------------------------------------------------------
        // required by DatabaseMetaData.getVersionColumns filter parameters
        // -----------------------------------------------------------------
        addColumn(t, "TABLE_CAT", SQL_IDENTIFIER);
        addColumn(t, "TABLE_SCHEM", SQL_IDENTIFIER);
        addColumn(t, "TABLE_NAME", SQL_IDENTIFIER);          // not null

        // -----------------------------------------------------------------
        HsqlName name = HsqlNameManager.newInfoSchemaObjectName(
            sysTableHsqlNames[SYSTEM_VERSIONCOLUMNS].name, false,
            SchemaObject.INDEX);

        t.createPrimaryKeyConstraint(name, null, false);

        return t;
    }

    return t;
}
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:75,代码来源:DatabaseInformationMain.java


示例12: ADMINISTRABLE_ROLE_AUTHORIZATIONS

import org.hsqldb.SchemaObject; //导入依赖的package包/类
/**
 * SQL:2008 VIEW<p>
 *
 * ADMINISTRABLE_ROLE_AUTHORIZATIONS<p>
 *
 * Returns roles that are grantable by an admin user, which means all the
 * roles.
 *
 * @return Table
 */
Table ADMINISTRABLE_ROLE_AUTHORIZATIONS(Session session,
        PersistentStore store) {

    Table t = sysTables[ADMINISTRABLE_ROLE_AUTHORIZATIONS];

    if (t == null) {
        t = createBlankTable(
            sysTableHsqlNames[ADMINISTRABLE_ROLE_AUTHORIZATIONS]);

        addColumn(t, "GRANTEE", SQL_IDENTIFIER);
        addColumn(t, "ROLE_NAME", SQL_IDENTIFIER);
        addColumn(t, "IS_GRANTABLE", SQL_IDENTIFIER);

        HsqlName name = HsqlNameManager.newInfoSchemaObjectName(
            sysTableHsqlNames[ADMINISTRABLE_ROLE_AUTHORIZATIONS].name,
            false, SchemaObject.INDEX);

        t.createPrimaryKeyConstraint(name, new int[] {
            0, 1, 2
        }, false);

        return t;
    }

    if (session.isAdmin()) {
        insertRoles(session, t, session.getGrantee(), true);
    }

    return t;
}
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:41,代码来源:DatabaseInformationFull.java


示例13: checkParametersSet

import org.hsqldb.SchemaObject; //导入依赖的package包/类
/**
 * Called just before execution or adding to batch, this ensures all the
 * parameters have been set.<p>
 *
 * If a parameter has been set using a stream method, it should be set
 * again for the next reuse. When set using other methods, the parameter
 * setting is retained for the next use.
 * @throws SQLException
 */
private void checkParametersSet() throws SQLException {

    if (isResult) {
        return;
    }

    for (int i = 0; i < parameterSet.length; i++) {
        if (parameterModes[i] != SchemaObject.ParameterModes.PARAM_OUT) {
            if (parameterSet[i] == null) {
                throw JDBCUtil.sqlException(ErrorCode.JDBC_PARAMETER_NOT_SET);
            }
        }
    }
}
 
开发者ID:Julien35,项目名称:dev-courses,代码行数:24,代码来源:JDBCPreparedStatement.java


示例14: ASSERTIONS

import org.hsqldb.SchemaObject; //导入依赖的package包/类
/**
 * SQL:2008 VIEW<p>
 *
 * The ASSERTIONS view is empty.<p>
 *
 */
Table ASSERTIONS(Session session, PersistentStore store) {

    Table t = sysTables[ASSERTIONS];

    if (t == null) {
        t = createBlankTable(sysTableHsqlNames[ASSERTIONS]);

        addColumn(t, "CONSTRAINT_CATALOG", SQL_IDENTIFIER);
        addColumn(t, "CONSTRAINT_SCHEMA", SQL_IDENTIFIER);
        addColumn(t, "CONSTRAINT_NAME", SQL_IDENTIFIER);    // not null
        addColumn(t, "IS_DEFERRABLE", YES_OR_NO);
        addColumn(t, "INITIALLY_DEFERRED", YES_OR_NO);

        HsqlName name = HsqlNameManager.newInfoSchemaObjectName(
            sysTableHsqlNames[ASSERTIONS].name, false, SchemaObject.INDEX);

        t.createPrimaryKeyConstraint(name, new int[] {
            0, 1, 2
        }, false);

        return t;
    }

    final int constraint_catalog = 0;
    final int constraint_schema  = 1;
    final int constraint_name    = 2;
    final int is_deferrable      = 3;
    final int initially_deferred = 4;

    return t;
}
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:38,代码来源:DatabaseInformationFull.java


示例15: DATA_TYPE_PRIVILEGES

import org.hsqldb.SchemaObject; //导入依赖的package包/类
/**
 * SQL:2008 VIEW<p>
 *
 * The DATA_TYPE_PRIVILEGES view has one row for each use of a data type.
 * Currently this view does not report the DTD_IDENTIFIER column.
 * <b>Definition:</b> <p>
 *
 * <pre class="SqlCodeExample">
 *      OBJECT_CATALOG      VARCHAR
 *      OBJECT_SCHEMA       VARCHAR
 *      OBJECT_NAME         VARCHAR
 *      OBJECT_TYPE         VARCHAR
 *      DTD_IDENTIFIER      VARCHAR
 * </pre>
 *
 * <b>Description:</b> <p>
 *
 * <ol>
 * <li> The values of OBJECT_CATALOG, OBJECT_SCHEMA, and
 *      OBJECT_NAME are the catalog name, schema name,
 *       and identifier, respectively, of the object. <p>
 *
 * <li> The value of OBJECT_TYPE is the type of the object, for example
 *      'TABLE'.
 *
 * <1i> Tables are reported only if the user or one of its roles is
 *      the authorization (owner) of the table.
 * </ol>
 *
 * @return Table
 */
Table DATA_TYPE_PRIVILEGES(Session session, PersistentStore store) {

    Table t = sysTables[DATA_TYPE_PRIVILEGES];

    if (t == null) {
        t = createBlankTable(sysTableHsqlNames[DATA_TYPE_PRIVILEGES]);

        addColumn(t, "OBJECT_CATALOG", SQL_IDENTIFIER);
        addColumn(t, "OBJECT_SCHEMA", SQL_IDENTIFIER);
        addColumn(t, "OBJECT_NAME", SQL_IDENTIFIER);    // not null
        addColumn(t, "OBJECT_TYPE", SQL_IDENTIFIER);
        addColumn(t, "DTD_IDENTIFIER", SQL_IDENTIFIER);

        HsqlName name = HsqlNameManager.newInfoSchemaObjectName(
            sysTableHsqlNames[DATA_TYPE_PRIVILEGES].name, false,
            SchemaObject.INDEX);

        t.createPrimaryKeyConstraint(name, new int[] {
            0, 1, 2, 3, 4
        }, false);

        return t;
    }

    //
    Session sys = database.sessionManager.newSysSession(
        SqlInvariants.INFORMATION_SCHEMA_HSQLNAME, session.getUser());
    String sql = (String) statementMap.get("/*data_type_privileges*/");
    Result rs  = sys.executeDirectStatement(sql);

    t.insertSys(session, store, rs);
    sys.close();

    return t;
}
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:67,代码来源:DatabaseInformationFull.java


示例16: JAR_JAR_USAGE

import org.hsqldb.SchemaObject; //导入依赖的package包/类
/**
 * SQL:2008 VIEW<p>
 *
 * The JAR_JAR_USAGE view is empty.<p>
 *
 */
Table JAR_JAR_USAGE(Session session, PersistentStore store) {

    Table t = sysTables[JAR_JAR_USAGE];

    if (t == null) {
        t = createBlankTable(sysTableHsqlNames[JAR_JAR_USAGE]);

        addColumn(t, "PATH_JAR_CATALOG", SQL_IDENTIFIER);
        addColumn(t, "PATH_JAR_SCHAMA", SQL_IDENTIFIER);
        addColumn(t, "PATH_JAR_NAME", SQL_IDENTIFIER);
        addColumn(t, "JAR_CATALOG", SQL_IDENTIFIER);
        addColumn(t, "JAR_SCHEMA", SQL_IDENTIFIER);
        addColumn(t, "JAR_NAME", SQL_IDENTIFIER);

        HsqlName name = HsqlNameManager.newInfoSchemaObjectName(
            sysTableHsqlNames[JAR_JAR_USAGE].name, false,
            SchemaObject.INDEX);

        t.createPrimaryKeyConstraint(name, new int[] {
            0, 1, 2, 3, 4, 5
        }, false);

        return t;
    }

    // column number mappings
    final int path_jar_catalog = 0;
    final int path_jar_schema  = 1;
    final int path_jar_name    = 2;
    final int jar_catalog      = 3;
    final int jar_schema       = 4;
    final int jar_name         = 5;

    //
    Iterator it;
    Object[] row;

    return t;
}
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:46,代码来源:DatabaseInformationFull.java


示例17: JARS

import org.hsqldb.SchemaObject; //导入依赖的package包/类
/**
 * SQL:2008 VIEW<p>
 *
 * The JARS view is empty.<p>
 *
 */
Table JARS(Session session, PersistentStore store) {

    Table t = sysTables[JARS];

    if (t == null) {
        t = createBlankTable(sysTableHsqlNames[JARS]);

        addColumn(t, "JAR_CATALOG", SQL_IDENTIFIER);
        addColumn(t, "JAR_SCHEMA", SQL_IDENTIFIER);
        addColumn(t, "JAR_NAME", SQL_IDENTIFIER);
        addColumn(t, "JAR_PATH", CHARACTER_DATA);

        HsqlName name = HsqlNameManager.newInfoSchemaObjectName(
            sysTableHsqlNames[JARS].name, false, SchemaObject.INDEX);

        t.createPrimaryKeyConstraint(name, new int[] {
            0, 1, 2, 3
        }, false);

        return t;
    }

    // column number mappings
    final int jar_catalog = 0;
    final int jar_schema  = 1;
    final int jar_name    = 2;
    final int jar_path    = 3;

    //
    Iterator it;
    Object[] row;

    return t;
}
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:41,代码来源:DatabaseInformationFull.java


示例18: ROLE_UDT_GRANTS

import org.hsqldb.SchemaObject; //导入依赖的package包/类
/**
 * SQL:2008 VIEW<p>
 *
 * The ROLE_UDT_GRANT view has one row for each privilege granted to each
 * user defined type. <p>
 *
 * <b>Definition:</b><p>
 *
 * <pre class="SqlCodeExample">
 *      GRANTOR                        VARCHAR ,
 *      GRANTEE                        VARCHAR ,
 *      UDT_CATALOG                    VARCHAR ,
 *      UDT_SCHEMA                     VARCHAR ,
 *      UDT_NAME                       VARCHAR ,
 *      PRIVILEGE_TYPE                 VARCHAR ,
 *      IS_GRANTABLE                   VARCHAR ,
 * </pre>
 *
 * <b>Description:</b><p>
 *
 * <ol>
 * <li> The values of GRANTOR is the grantor of the privilege. The value of
 *      GRANTEE is the name of the ROLE.
 *
 * <li> The values of UDT_CATALOG, UDT_SCHEMA and
 *      UDT_NAME are the catalog name, schema name and
 *      table name, respectively, of the table level grant being
 *      described. <p>
 *
 * <li> The value of PRIVILEGE_TYPE is the type of the privilege, including,
 *      'USAGE'.
 *      The value IS_GRANTABLE is 'YES' if the privilege is grantable. <p>
 * </ol>
 *
 * @return Table
 */
Table ROLE_UDT_GRANTS(Session session, PersistentStore store) {

    Table t = sysTables[ROLE_UDT_GRANTS];

    if (t == null) {
        t = createBlankTable(sysTableHsqlNames[ROLE_UDT_GRANTS]);

        addColumn(t, "GRANTOR", SQL_IDENTIFIER);     // not null
        addColumn(t, "GRANTEE", SQL_IDENTIFIER);     // not null
        addColumn(t, "UDT_CATALOG", SQL_IDENTIFIER);
        addColumn(t, "UDT_SCHEMA", SQL_IDENTIFIER);
        addColumn(t, "UDT_NAME", SQL_IDENTIFIER);    // not null
        addColumn(t, "PRIVILEGE_TYPE", CHARACTER_DATA);
        addColumn(t, "IS_GRANTABLE", YES_OR_NO);     // not null

        HsqlName name = HsqlNameManager.newInfoSchemaObjectName(
            sysTableHsqlNames[ROLE_UDT_GRANTS].name, false,
            SchemaObject.INDEX);

        t.createPrimaryKeyConstraint(name, null, false);

        return t;
    }

    Session sys = database.sessionManager.newSysSession(
        SqlInvariants.INFORMATION_SCHEMA_HSQLNAME, session.getUser());
    Result rs = sys.executeDirectStatement(
        "SELECT U.GRANTOR, U.GRANTEE, U.UDT_CATALOG, U.UDT_SCHEMA, U.UDT_NAME, "
        + "U.PRIVILEGE_TYPE, U.IS_GRANTABLE "
        + "FROM INFORMATION_SCHEMA.UDT_PRIVILEGES U "
        + "JOIN INFORMATION_SCHEMA.APPLICABLE_ROLES ON U.GRANTEE = ROLE_NAME;");

    t.insertSys(session, store, rs);
    sys.close();

    return t;
}
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:74,代码来源:DatabaseInformationFull.java


示例19: SQL_IMPLEMENTATION_INFO

import org.hsqldb.SchemaObject; //导入依赖的package包/类
/**
 * SQL:2008 VIEW<p>
 *
 * The SQL_IMPLEMENTATION_INFO shows some properties and capabilities
 * of the database engine .<p>
 *
 */
Table SQL_IMPLEMENTATION_INFO(Session session, PersistentStore store) {

    Table t = sysTables[SQL_IMPLEMENTATION_INFO];

    if (t == null) {
        t = createBlankTable(sysTableHsqlNames[SQL_IMPLEMENTATION_INFO]);

        addColumn(t, "IMPLEMENTATION_INFO_ID", CARDINAL_NUMBER);
        addColumn(t, "IMPLEMENTATION_INFO_NAME", CHARACTER_DATA);
        addColumn(t, "INTEGER_VALUE", CARDINAL_NUMBER);
        addColumn(t, "CHARACTER_VALUE", CHARACTER_DATA);
        addColumn(t, "COMMENTS", CHARACTER_DATA);

        HsqlName name = HsqlNameManager.newInfoSchemaObjectName(
            sysTableHsqlNames[SQL_IMPLEMENTATION_INFO].name, false,
            SchemaObject.INDEX);

        t.createPrimaryKeyConstraint(name, new int[]{ 0 }, false);

        return t;
    }

    Session sys = database.sessionManager.newSysSession(
        SqlInvariants.INFORMATION_SCHEMA_HSQLNAME, session.getUser());
    String sql = (String) statementMap.get("/*sql_implementation_info*/");
    Result rs  = sys.executeDirectStatement(sql);

    t.insertSys(session, store, rs);

    return t;
}
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:39,代码来源:DatabaseInformationFull.java


示例20: SQL_PARTS

import org.hsqldb.SchemaObject; //导入依赖的package包/类
/**
 * SQL:2008 VIEW<p>
 *
 * The SQL_PARTS view lists the parts of the SQL Standard supported by
 * HyperSQL.<p>
 *
 */
Table SQL_PARTS(Session session, PersistentStore store) {

    Table t = sysTables[SQL_PARTS];

    if (t == null) {
        t = createBlankTable(sysTableHsqlNames[SQL_PARTS]);

        addColumn(t, "PART", CHARACTER_DATA);
        addColumn(t, "NAME", CHARACTER_DATA);
        addColumn(t, "IS_SUPPORTED", YES_OR_NO);
        addColumn(t, "IS_VERIFIED_BY", CHARACTER_DATA);
        addColumn(t, "COMMENTS", CHARACTER_DATA);

        HsqlName name = HsqlNameManager.newInfoSchemaObjectName(
            sysTableHsqlNames[SQL_PARTS].name, false, SchemaObject.INDEX);

        t.createPrimaryKeyConstraint(name, new int[]{ 0 }, false);

        return t;
    }

    Session sys = database.sessionManager.newSysSession(
        SqlInvariants.INFORMATION_SCHEMA_HSQLNAME, session.getUser());
    String sql = (String) statementMap.get("/*sql_parts*/");
    Result rs  = sys.executeDirectStatement(sql);

    t.insertSys(session, store, rs);

    return t;
}
 
开发者ID:tiweGH,项目名称:OpenDiabetes,代码行数:38,代码来源:DatabaseInformationFull.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java UniversalActionType类代码示例发布时间:2022-05-22
下一篇:
Java HttpHeader类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap