Class DB_GrantRevoke
java.lang.Object
org.apache.derby.impl.tools.dblook.DB_GrantRevoke
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static String
columnPrivStatement
(ResultSet rs, String fullName, String authName, ResultSet rsCols) static void
doAuthorizations
(Connection conn, boolean at10_6) Generate Grant and Revoke statements if sqlAuthorization is onstatic void
Generate aggregate privilege statementsprivate static void
generateColumnPrivs
(ResultSet rs, Connection conn) Generate column privilege statementsstatic void
Generate routine privilege statementsstatic void
Generate sequence privilege statementsprivate static void
Generate table privilege statementsstatic void
Generate udt privilege statementsprivate static String
genericPrivStatement
(String fullName, String authName, String permission, String objectType) private static String
mapColumnsToNames
(String columns, ResultSet rsCols) Generate one column grant statementprivate static String
privTypeToString
(String privType) private static String
routinePrivStatement
(String fullName, String authName, String aliasType) private static String
separatorStr
(boolean addSeparator) private static String
tablePrivStatement
(ResultSet rs, String fullName, String authName) Generate table privilege statement for the current row
-
Constructor Details
-
DB_GrantRevoke
public DB_GrantRevoke()
-
-
Method Details
-
doAuthorizations
Generate Grant and Revoke statements if sqlAuthorization is on- Parameters:
conn
- Connection to useat10_6
- True if the database level is 10.6 or higher- Throws:
SQLException
-
generateTablePrivs
Generate table privilege statements- Parameters:
rs
- Result set holding required information- Throws:
SQLException
-
separatorStr
-
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 informationfullName
- Table's qualified nameauthName
- Authorization id for grant statement- Throws:
SQLException
-
generateColumnPrivs
Generate column privilege statements- Parameters:
rs
- ResultSet holding column privilege informationconn
- Connection to use. Used to get another ResultSet- Throws:
SQLException
-
privTypeToString
-
mapColumnsToNames
Generate one column grant statement- Parameters:
columns
- List of columns to grant required privsrsCols
- 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 statementfullName
- Full qualified name of the tableauthName
- Authorization name for this GRANTrsCols
- ResultSet for mapping column numbers to names- Throws:
SQLException
-
generateUDTPrivs
Generate udt privilege statements- Parameters:
rs
- ResultSet holding required information- Throws:
SQLException
-
generateSequencePrivs
Generate sequence privilege statements- Parameters:
rs
- ResultSet holding required information- Throws:
SQLException
-
generateAggregatePrivs
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
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
-