Class DB_Roles

java.lang.Object
org.apache.derby.impl.tools.dblook.DB_Roles

public class DB_Roles extends Object
  • Constructor Details

    • DB_Roles

      public DB_Roles()
  • Method Details

    • doRoles

      public static void doRoles(Connection conn) throws SQLException
      Generate role definition statements and role grant statements. Note that privileges granted to roles are handled by DB_GrantRevoke, similar to privileges granted to users.
      Parameters:
      conn - Connection to use
      Throws:
      SQLException
    • generateRoleDefinitions

      private static void generateRoleDefinitions(ResultSet rs) throws SQLException
      Generate role definition statements
      Parameters:
      rs - Result set holding required information
      Throws:
      SQLException
    • roleDefinitionStatement

      private static String roleDefinitionStatement(ResultSet rs, String roleName) throws SQLException
      Generate a role definition statement for the current row
      Parameters:
      rs - @{code ResultSet} holding role definition information
      roleName - The role defined, already quoted
      Throws:
      SQLException
    • generateRoleGrants

      private static void generateRoleGrants(ResultSet rs) throws SQLException
      Throws:
      SQLException
    • roleGrantStatement

      private static String roleGrantStatement(ResultSet rs, String roleName, String grantee, boolean isWithAdminOption) throws SQLException
      Generate role grant statement for the current row
      Parameters:
      rs - @{ResultSet} holding role grant information
      roleName - The role granted, already quoted
      grantee - The authorization id to whom the role is granted (a role or a user), already quoted
      isWithAdminOption - @{code true} if ADMIN OPTION was used for the grant
      Throws:
      SQLException