Class DB_GrantRevoke
java.lang.Object
org.apache.derby.impl.tools.dblook.DB_GrantRevoke
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static StringcolumnPrivStatement(ResultSet rs, String fullName, String authName, ResultSet rsCols) static voiddoAuthorizations(Connection conn, boolean at10_6) Generate Grant and Revoke statements if sqlAuthorization is onstatic voidGenerate aggregate privilege statementsprivate static voidgenerateColumnPrivs(ResultSet rs, Connection conn) Generate column privilege statementsstatic voidGenerate routine privilege statementsstatic voidGenerate sequence privilege statementsprivate static voidGenerate table privilege statementsstatic voidGenerate udt privilege statementsprivate static StringgenericPrivStatement(String fullName, String authName, String permission, String objectType) private static StringmapColumnsToNames(String columns, ResultSet rsCols) Generate one column grant statementprivate static StringprivTypeToString(String privType) private static StringroutinePrivStatement(String fullName, String authName, String aliasType) private static StringseparatorStr(boolean addSeparator) private static StringtablePrivStatement(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
-