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

public Class DB_Roles

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

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static void
doRoles(Connection
Connection to use
conn
)

Generate role definition statements and role grant statements.

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

Generate role definition statements

private static void
private static String
roleDefinitionStatement(ResultSet
@{code ResultSet} holding role definition information
rs
,
String
The role defined, already quoted
roleName
)

Generate a role definition statement for the current row

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

Generate role grant statement for the current row

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

DB_Rolesback to summary
public DB_Roles()

Method Detail

doRolesback to summary
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

Connection to use

generateRoleDefinitionsback to summary
private static void generateRoleDefinitions(ResultSet rs) throws SQLException

Generate role definition statements

Parameters
rs:ResultSet

Result set holding required information

generateRoleGrantsback to summary
private static void generateRoleGrants(ResultSet rs) throws SQLException
roleDefinitionStatementback to summary
private static String roleDefinitionStatement(ResultSet rs, String roleName) throws SQLException

Generate a role definition statement for the current row

Parameters
rs:ResultSet

@{code ResultSet} holding role definition information

roleName:String

The role defined, already quoted

roleGrantStatementback to summary
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

@{ResultSet} holding role grant information

roleName:String

The role granted, already quoted

grantee:String

The authorization id to whom the role is granted (a role or a user), already quoted

isWithAdminOption:boolean

@{code true} if ADMIN OPTION was used for the grant