Top Constructors Methods
org.apache.derby.impl.tools.dblook

public Class DB_GrantRevoke

extends Object
Class Inheritance
Imports
java.sql.Connection, .PreparedStatement, .Statement, .ResultSet, .SQLException, java.util.StringTokenizer, org.apache.derby.tools.dblook

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static String
columnPrivStatement(ResultSet
ResultSet with info for this GRANT statement
rs
,
String
Full qualified name of the table
fullName
,
String
Authorization name for this GRANT
authName
,
ResultSet
ResultSet for mapping column numbers to names
rsCols
)

public static void
doAuthorizations(Connection
Connection to use
conn
,
boolean
True if the database level is 10.6 or higher
at10_6
)

Generate Grant and Revoke statements if sqlAuthorization is on

public static void
generateAggregatePrivs(ResultSet
ResultSet holding required information
rs
)

Generate aggregate privilege statements

private static void
generateColumnPrivs(ResultSet
ResultSet holding column privilege information
rs
,
Connection
Connection to use. Used to get another ResultSet
conn
)

Generate column privilege statements

public static void
generateRoutinePrivs(ResultSet
ResultSet holding required information
rs
)

Generate routine privilege statements

public static void
generateSequencePrivs(ResultSet
ResultSet holding required information
rs
)

Generate sequence privilege statements

private static void
generateTablePrivs(ResultSet
Result set holding required information
rs
)

Generate table privilege statements

public static void
generateUDTPrivs(ResultSet
ResultSet holding required information
rs
)

Generate udt privilege statements

private static String
genericPrivStatement(String fullName, String authName, String permission, String objectType)

private static String
mapColumnsToNames(String
List of columns to grant required privs
columns
,
ResultSet
ResultSet for mapping column numbers to names
rsCols
)

Generate one column grant statement

private static String
private static String
routinePrivStatement(String fullName, String authName, String aliasType)

private static String
separatorStr(boolean addSeparator)

private static String
tablePrivStatement(ResultSet
ResultSet holding tableperm information
rs
,
String
Table's qualified name
fullName
,
String
Authorization id for grant statement
authName
)

Generate table privilege statement for the current row

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

DB_GrantRevokeback to summary
public DB_GrantRevoke()

Method Detail

columnPrivStatementback to summary
private static String columnPrivStatement(ResultSet rs, String fullName, String authName, ResultSet rsCols) throws SQLException
Parameters
rs:ResultSet

ResultSet with info for this GRANT statement

fullName:String

Full qualified name of the table

authName:String

Authorization name for this GRANT

rsCols:ResultSet

ResultSet for mapping column numbers to names

doAuthorizationsback to summary
public static void doAuthorizations(Connection conn, boolean at10_6) throws SQLException

Generate Grant and Revoke statements if sqlAuthorization is on

Parameters
conn:Connection

Connection to use

at10_6:boolean

True if the database level is 10.6 or higher

generateAggregatePrivsback to summary
public static void generateAggregatePrivs(ResultSet rs) throws SQLException

Generate aggregate privilege statements

Parameters
rs:ResultSet

ResultSet holding required information

generateColumnPrivsback to summary
private static void generateColumnPrivs(ResultSet rs, Connection conn) throws SQLException

Generate column privilege statements

Parameters
rs:ResultSet

ResultSet holding column privilege information

conn:Connection

Connection to use. Used to get another ResultSet

generateRoutinePrivsback to summary
public static void generateRoutinePrivs(ResultSet rs) throws SQLException

Generate routine privilege statements

Parameters
rs:ResultSet

ResultSet holding required information

generateSequencePrivsback to summary
public static void generateSequencePrivs(ResultSet rs) throws SQLException

Generate sequence privilege statements

Parameters
rs:ResultSet

ResultSet holding required information

generateTablePrivsback to summary
private static void generateTablePrivs(ResultSet rs) throws SQLException

Generate table privilege statements

Parameters
rs:ResultSet

Result set holding required information

generateUDTPrivsback to summary
public static void generateUDTPrivs(ResultSet rs) throws SQLException

Generate udt privilege statements

Parameters
rs:ResultSet

ResultSet holding required information

genericPrivStatementback to summary
private static String genericPrivStatement(String fullName, String authName, String permission, String objectType) throws SQLException
mapColumnsToNamesback to summary
private static String mapColumnsToNames(String columns, ResultSet rsCols) throws SQLException

Generate one column grant statement

Parameters
columns:String

List of columns to grant required privs

rsCols:ResultSet

ResultSet for mapping column numbers to names

privTypeToStringback to summary
private static String privTypeToString(String privType)
routinePrivStatementback to summary
private static String routinePrivStatement(String fullName, String authName, String aliasType) throws SQLException
separatorStrback to summary
private static String separatorStr(boolean addSeparator)
tablePrivStatementback to summary
private static String tablePrivStatement(ResultSet rs, String fullName, String authName) throws SQLException

Generate table privilege statement for the current row

Parameters
rs:ResultSet

ResultSet holding tableperm information

fullName:String

Table's qualified name

authName:String

Authorization id for grant statement