org.apache.derby.impl.tools.dblook
Class DB_Roles

java.lang.Object
  extended by org.apache.derby.impl.tools.dblook.DB_Roles

public class DB_Roles
extends java.lang.Object


Constructor Summary
DB_Roles()
           
 
Method Summary
static void doRoles(java.sql.Connection conn)
          Generate role definition statements and role grant statements.
private static void generateRoleDefinitions(java.sql.ResultSet rs)
          Generate role definition statements
private static void generateRoleGrants(java.sql.ResultSet rs)
           
private static java.lang.String roleDefinitionStatement(java.sql.ResultSet rs, java.lang.String roleName)
          Generate a role definition statement for the current row
private static java.lang.String roleGrantStatement(java.sql.ResultSet rs, java.lang.String roleName, java.lang.String grantee, boolean isWithAdminOption)
          Generate role grant statement for the current row
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DB_Roles

public DB_Roles()
Method Detail

doRoles

public static void doRoles(java.sql.Connection conn)
                    throws java.sql.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 to use
Throws:
java.sql.SQLException

generateRoleDefinitions

private static void generateRoleDefinitions(java.sql.ResultSet rs)
                                     throws java.sql.SQLException
Generate role definition statements

Parameters:
rs - Result set holding required information
Throws:
java.sql.SQLException

roleDefinitionStatement

private static java.lang.String roleDefinitionStatement(java.sql.ResultSet rs,
                                                        java.lang.String roleName)
                                                 throws java.sql.SQLException
Generate a role definition statement for the current row

Parameters:
rs - @{code ResultSet} holding role definition information
roleName - The role defined, already quoted
Throws:
java.sql.SQLException

generateRoleGrants

private static void generateRoleGrants(java.sql.ResultSet rs)
                                throws java.sql.SQLException
Throws:
java.sql.SQLException

roleGrantStatement

private static java.lang.String roleGrantStatement(java.sql.ResultSet rs,
                                                   java.lang.String roleName,
                                                   java.lang.String grantee,
                                                   boolean isWithAdminOption)
                                            throws java.sql.SQLException
Generate role grant statement for the current row

Parameters:
rs - @{ResultSet} holding role grant information
roleName - The role granted, already quoted
grantee - The authorization id to whom the role is granted (a role or a user), already quoted
isWithAdminOption - @{code true} if ADMIN OPTION was used for the grant
Throws:
java.sql.SQLException

Built on Thu 2012-03-29 21:53:33+0000, from revision ???

Apache Derby V10.6 Internals - Copyright © 2004,2007 The Apache Software Foundation. All Rights Reserved.