Class DB_GrantRevoke

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

public class DB_GrantRevoke extends Object
  • Constructor Details

    • DB_GrantRevoke

      public DB_GrantRevoke()
  • Method Details

    • doAuthorizations

      public static void doAuthorizations(Connection conn, boolean at10_6) throws SQLException
      Generate Grant and Revoke statements if sqlAuthorization is on
      Parameters:
      conn - Connection to use
      at10_6 - True if the database level is 10.6 or higher
      Throws:
      SQLException
    • generateTablePrivs

      private static void generateTablePrivs(ResultSet rs) throws SQLException
      Generate table privilege statements
      Parameters:
      rs - Result set holding required information
      Throws:
      SQLException
    • separatorStr

      private static String separatorStr(boolean addSeparator)
    • tablePrivStatement

      private static String tablePrivStatement(ResultSet rs, String fullName, String authName) throws SQLException
      Generate table privilege statement for the current row
      Parameters:
      rs - ResultSet holding tableperm information
      fullName - Table's qualified name
      authName - Authorization id for grant statement
      Throws:
      SQLException
    • generateColumnPrivs

      private static void generateColumnPrivs(ResultSet rs, Connection conn) throws SQLException
      Generate column privilege statements
      Parameters:
      rs - ResultSet holding column privilege information
      conn - Connection to use. Used to get another ResultSet
      Throws:
      SQLException
    • privTypeToString

      private static String privTypeToString(String privType)
    • mapColumnsToNames

      private static String mapColumnsToNames(String columns, ResultSet rsCols) throws SQLException
      Generate one column grant statement
      Parameters:
      columns - List of columns to grant required privs
      rsCols - ResultSet for mapping column numbers to names
      Throws:
      SQLException
    • columnPrivStatement

      private static String columnPrivStatement(ResultSet rs, String fullName, String authName, ResultSet rsCols) throws SQLException
      Parameters:
      rs - ResultSet with info for this GRANT statement
      fullName - Full qualified name of the table
      authName - Authorization name for this GRANT
      rsCols - ResultSet for mapping column numbers to names
      Throws:
      SQLException
    • generateUDTPrivs

      public static void generateUDTPrivs(ResultSet rs) throws SQLException
      Generate udt privilege statements
      Parameters:
      rs - ResultSet holding required information
      Throws:
      SQLException
    • generateSequencePrivs

      public static void generateSequencePrivs(ResultSet rs) throws SQLException
      Generate sequence privilege statements
      Parameters:
      rs - ResultSet holding required information
      Throws:
      SQLException
    • generateAggregatePrivs

      public static void generateAggregatePrivs(ResultSet rs) throws SQLException
      Generate aggregate privilege statements
      Parameters:
      rs - ResultSet holding required information
      Throws:
      SQLException
    • genericPrivStatement

      private static String genericPrivStatement(String fullName, String authName, String permission, String objectType) throws SQLException
      Throws:
      SQLException
    • generateRoutinePrivs

      public static void generateRoutinePrivs(ResultSet rs) throws SQLException
      Generate routine privilege statements
      Parameters:
      rs - ResultSet holding required information
      Throws:
      SQLException
    • routinePrivStatement

      private static String routinePrivStatement(String fullName, String authName, String aliasType) throws SQLException
      Throws:
      SQLException