public class RolesConferredPrivilegesTest extends BaseJDBCTestCase
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
ALREADYCLOSED |
private static java.lang.String |
CHECKCONSTRAINTVIOLATED |
private static java.lang.String |
CONSTRAINTDROPPED |
private static java.lang.String |
FKVIOLATION |
private static java.lang.String[] |
g_all |
private static java.lang.String[] |
g_all_col |
private static java.lang.String[] |
g_all_tab |
private static java.lang.String |
g_d |
private static java.lang.String |
g_e |
private static java.lang.String |
g_e_f2 |
private static java.lang.String |
g_i |
private static java.lang.String |
g_r |
private static java.lang.String |
g_r_c1 |
private static java.lang.String |
g_r_c2 |
private static java.lang.String |
g_r_c3 |
private static java.lang.String |
g_s |
private static java.lang.String |
g_s_c1 |
private static java.lang.String |
g_s_c2 |
private static java.lang.String |
g_s_c3 |
private static java.lang.String |
g_t |
private static java.lang.String |
g_u |
private static java.lang.String |
g_u_c1 |
private static java.lang.String |
g_u_c1_c2_c3 |
private static java.lang.String |
g_u_c2 |
private static java.lang.String |
g_u_c3 |
private static int |
GRANT |
private static java.lang.String[][] |
grantRevokes |
private static java.lang.String |
NOCOLUMNPERMISSION |
private static java.lang.String |
NOEXECUTEPERMISSION |
private static int |
NOPRIV |
private static java.lang.String |
NOTABLEPERMISSION |
private static java.lang.String |
OBJECTNOTFOUND |
private static java.lang.String |
pwSuffix |
private static int |
REVOKE |
private static java.lang.String |
TABLENOTFOUND |
private static java.lang.String |
TRIGGERDROPPED |
private static java.lang.String |
UNRELIABLE |
private static java.lang.String[] |
users |
private static int |
VIAROLE |
private static int |
VIAUSER |
private static java.lang.String |
VIEWDROPPED |
DEFAULT_DB_DIR, DERBY_LOG, ERRORSTACKTRACEFILE
Constructor and Description |
---|
RolesConferredPrivilegesTest(java.lang.String name)
Create a new instance of RolesConferredPrivilegesTest.
|
Modifier and Type | Method and Description |
---|---|
private void |
assertAllforRole(int hasPrivilege,
java.sql.Connection c,
java.lang.String grantee) |
private void |
assertCheckConstraintExists(boolean exists,
java.sql.Connection c,
java.lang.String table)
Check that a given check constraint exists by the following method: We
insert a value that does not satify the check constraint.
|
private void |
assertConstraintExists(boolean exists,
java.sql.Connection c,
java.lang.String table,
java.lang.String sqlState) |
private void |
assertDeletePrivilege(int hasPrivilege,
java.sql.Connection c,
java.lang.String schema,
java.lang.String table)
Assert that a user has delete privilege on a given table.
|
private void |
assertDeletePrivilege(int hasPrivilege,
java.lang.String user,
java.lang.String role,
java.lang.String schema,
java.lang.String table)
Assert that a user has delete privilege on a given table
|
private void |
assertEverything(int hasPrivilege,
java.sql.Connection c,
java.lang.String role) |
private void |
assertEverything(int hasPrivilege,
java.lang.String user,
java.lang.String role) |
private void |
assertExecutePrivilege(int hasPrivilege,
java.sql.Connection c,
java.lang.String schema,
java.lang.String function)
Assert that a user has execute privilege on a given function
|
private void |
assertExecutePrivilege(int hasPrivilege,
java.lang.String user,
java.lang.String role,
java.lang.String schema,
java.lang.String function)
Assert that a user has execute privilege on a given function
|
private void |
assertFkConstraintExists(boolean exists,
java.sql.Connection c,
java.lang.String table)
Check that a given foregin key constraint exists by the following
method: We insert a value that is not present in the referenced table so
the foreign key constraint will fail if the constraint is present.
|
private void |
assertInsertPrivilege(int hasPrivilege,
java.sql.Connection c,
java.lang.String schema,
java.lang.String table,
java.lang.String[] columns)
Assert that a user has insert privilege on a given table / column set.
|
private void |
assertInsertPrivilege(int hasPrivilege,
java.lang.String user,
java.lang.String role,
java.lang.String schema,
java.lang.String table,
java.lang.String[] columns)
Assert that a user has insert privilege on a given table
|
private void |
assertPrivilegeMetadata(int hasPrivilege,
java.sql.Connection c,
java.lang.String type,
java.lang.String schema,
java.lang.String table,
java.lang.String[] columns)
Assert that a specific privilege exists by checking the
database metadata available to a user.
|
private void |
assertPsWorks(boolean works,
java.sql.PreparedStatement ps)
Check that a given prepared statement can be executed.
|
private void |
assertReferencesPrivilege(int hasPrivilege,
java.sql.Connection c,
java.lang.String schema,
java.lang.String table,
java.lang.String[] columns)
Assert that a user has references privilege on a given table / column
set.
|
private void |
assertReferencesPrivilege(int hasPrivilege,
java.lang.String user,
java.lang.String role,
java.lang.String schema,
java.lang.String table,
java.lang.String[] columns)
Assert that a user has references privilege on a given table
|
private void |
assertSelectConstantPrivilege(int hasPrivilege,
java.sql.Connection c,
java.lang.String schema,
java.lang.String table,
java.lang.String sqlState)
Assert that a user has select privilege at the table(s) level or
atleast on one column from each of the tables involved in the
query when running a select query which only selects constants from
the tables.
|
private void |
assertSelectCountPrivilege(int hasPrivilege,
java.sql.Connection c,
java.lang.String schema,
java.lang.String table,
java.lang.String[] columns,
java.lang.String sqlState)
Assert that a user has select privilege at the table(s) level or
atleast on one column from each of the tables involved in the
query when running a select query which selects count(*) or
count(constant) from the tables.
|
private void |
assertSelectPrivilege(int hasPrivilege,
java.sql.Connection c,
java.lang.String schema,
java.lang.String table,
java.lang.String[] columns)
Assert that a user has select privilege on a given table / column set.
|
private void |
assertSelectPrivilege(int hasPrivilege,
java.sql.Connection c,
java.lang.String schema,
java.lang.String table,
java.lang.String[] columns,
java.lang.String sqlState)
Assert that a user has select privilege on a given table / column set.
|
private void |
assertSelectPrivilege(int hasPrivilege,
java.lang.String user,
java.lang.String role,
java.lang.String schema,
java.lang.String table,
java.lang.String[] columns)
Assert that a user has select privilege on a given table
|
private void |
assertSQLState(java.lang.String[] ok_states,
java.sql.SQLException e) |
private void |
assertTriggerExists(boolean exists,
java.sql.Connection c,
java.lang.String trigger)
Check that a given trigger exists (select privilege assumed) or not.
|
private void |
assertTriggerPrivilege(int hasPrivilege,
java.sql.Connection c,
java.lang.String schema,
java.lang.String table)
Assert that a user has trigger execute privilege on a given table /
column set.
|
private void |
assertTriggerPrivilege(int hasPrivilege,
java.lang.String user,
java.lang.String role,
java.lang.String schema,
java.lang.String table)
Assert that a user has trigger privilege on a given table
|
private void |
assertUpdatePrivilege(int hasPrivilege,
java.sql.Connection c,
java.lang.String schema,
java.lang.String table,
java.lang.String[] columns)
Assert that a user has update privilege on a given table / column set.
|
private void |
assertUpdatePrivilege(int hasPrivilege,
java.lang.String user,
java.lang.String role,
java.lang.String schema,
java.lang.String table,
java.lang.String[] columns)
Assert that a user has update privilege on a given table
|
private void |
assertViewExists(boolean exists,
java.sql.Connection c,
java.lang.String table)
Check that a given view exists (select privilege assumed) or not by
selecting from it.
|
void |
atestConferredPrivileges()
Basic test that checks that privileges granted to a role are applicable
when the user sets the current role to that role (or to a role that
inherits that role).
|
static void |
calledNested() |
private java.lang.String |
CNFUser2user(java.lang.String CNFUser) |
private static java.lang.String |
columnListAsString(java.lang.String[] columns)
Return the given String array as a comma separated String
|
private void |
doGrantRevoke(int action,
java.lang.String grantor,
java.lang.String[] actionStrings,
java.lang.String grantee)
Perform a bulk grant or revoke action for grantee
|
private void |
doGrantRevoke(int action,
java.lang.String grantor,
java.lang.String[] actionStrings,
java.lang.String grantee,
java.lang.String[] warningExpected)
Perform a bulk grant or revoke action for grantee
|
private void |
doGrantRevoke(int action,
java.lang.String grantor,
java.lang.String actionString,
java.lang.String grantee)
Perform a bulk grant or revoke action for grantee
|
private void |
doGrantRevoke(int action,
java.lang.String grantor,
java.lang.String actionString,
java.lang.String grantee,
java.lang.String warningExpected)
Perform a bulk grant or revoke action for grantee
|
private static java.lang.String |
formatArgs(java.sql.Connection c,
java.lang.String schema,
java.lang.String dbObject)
Format the dbObject arguments used by the various assert* methods for
printing.
|
private static java.lang.String |
formatArgs(java.sql.Connection c,
java.lang.String schema,
java.lang.String table,
java.lang.String[] columns)
Format the table arguments used by the various assert* methods for
printing.
|
private java.lang.String[] |
getAllColumns(java.lang.String schema,
java.lang.String table)
Get all the columns in a given schema / table
|
static java.lang.String |
getCurrentRole() |
private boolean |
isOwner(java.lang.String schema,
java.lang.String user) |
private static junit.framework.Test |
makeSuite()
Construct suite of tests
|
static int |
s1f1()
stored function: s1.f1
|
private void |
setRole(java.sql.Connection c,
java.lang.String role)
Set the given role for the current session.
|
static junit.framework.Test |
suite()
Construct top level suite in this JUnit test
|
void |
testConstraintInvalidation() |
void |
testCurrentRoleInWeirdContexts()
Test that CURRENT_ROLE works as expected in some miscellaneous contexts.
|
void |
testDefaultCurrentRole()
Test that DEFAULT CURRENT_ROLE works as expected
See DERBY-3897.
|
void |
testMinimumSelectPrivilege()
DERBY-4191
There are times when no column is selected from a table in the from
list.
|
void |
testOpenRs()
Test behavior for when there are open result sets on prepared statements
that require privileges obtained via the current role and something
changes in the middle of accessing the result set.
|
void |
testPSInvalidation()
Test that a prepared statement can no longer execute after its required
privileges acquired via the current role are no longer applicable.
|
void |
testTriggerInvalidation() |
void |
testViewInvalidation()
When a view, a trigger or a constraint requires a privilege by way of
the current role (or by way of a role inherited by the current role) at
creation time (SELECT, TRIGGER or REFERENCES privilege respectively), a
dependency is also registered against the current role.
|
assertCallError, assertCheckTable, assertCommitError, assertCompileError, assertEquals, assertEquals, assertEquals, assertEquivalentDataType, assertErrorCode, assertGetIntError, assertNextError, assertPreparedStatementError, assertResults, assertResults, assertSQLExceptionEquals, assertSQLState, assertSQLState, assertStatementError, assertStatementError, assertStatementError, assertStatementError, assertStatementErrorUnordered, assertTableRowCount, assertUpdateCount, assertUpdateCount, assertWarning, chattyPrepare, chattyPrepareCall, checkAllConsistency, checkEstimatedRowCount, closeStatement, commit, createStatement, createStatement, createStatement, dropTable, dropTable, dropView, dropView, dumpRs, dumpRs, emptyStatementCache, executeQuery, expectCompilationError, expectCompilationError, expectExecutionError, getClientTransactionID, getConnection, getDatabaseProperty, getLastSQLException, goodStatement, goodUpdate, initializeConnection, openConnection, openDefaultConnection, openDefaultConnection, openDefaultConnection, openUserConnection, prepareCall, prepareCall, prepareCall, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, rollback, runBare, runBareOverridable, runScript, runScript, runSQLCommands, setAutoCommit, tearDown, usingDB2Client, usingDerbyNetClient, usingEmbedded
alarm, assertDirectoryDeleted, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertExecJavaCmdAsExpected, assertLaunchedJUnitTestMethod, assertLaunchedJUnitTestMethod, assertSameNullness, assertSecurityManager, assertThrowableEquals, currentDirectory, execJavaCmd, execJavaCmd, execJavaCmd, fail, getClassVersionMajor, getEmmaJar, getFailureFolder, getFilesWith, getJavaExecutableName, getSystemProperty, getTestConfiguration, getTestResource, hasInterruptibleIO, isCVM, isIBMJVM, isJ9Platform, isJava5, isJava7, isPhoneME, isPlatform, isSunJVM, isWindowsPlatform, newAssertionFailedError, openTestResource, println, printStackTrace, readProcessOutput, removeDirectory, removeDirectory, removeFiles, removeSystemProperty, runsWithEmma, runsWithJaCoCo, setSystemErr, setSystemOut, setSystemProperty, sleep, sleepAtLeastOneTick, traceit, vmAtLeast
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runTest, setName, setUp, toString
private static final java.lang.String pwSuffix
private static final java.lang.String NOEXECUTEPERMISSION
private static final java.lang.String NOTABLEPERMISSION
private static final java.lang.String NOCOLUMNPERMISSION
private static final java.lang.String TABLENOTFOUND
private static final java.lang.String OBJECTNOTFOUND
private static final java.lang.String FKVIOLATION
private static final java.lang.String CHECKCONSTRAINTVIOLATED
private static final java.lang.String ALREADYCLOSED
private static final java.lang.String CONSTRAINTDROPPED
private static final java.lang.String VIEWDROPPED
private static final java.lang.String TRIGGERDROPPED
private static final java.lang.String UNRELIABLE
private static final java.lang.String[] users
private static final int GRANT
private static final int REVOKE
private static final int NOPRIV
private static final int VIAUSER
private static final int VIAROLE
private static final java.lang.String g_r
private static final java.lang.String g_r_c1
private static final java.lang.String g_r_c2
private static final java.lang.String g_r_c3
private static final java.lang.String g_u
private static final java.lang.String g_u_c1
private static final java.lang.String g_u_c2
private static final java.lang.String g_u_c3
private static final java.lang.String g_u_c1_c2_c3
private static final java.lang.String g_i
private static final java.lang.String g_s
private static final java.lang.String g_s_c1
private static final java.lang.String g_s_c2
private static final java.lang.String g_s_c3
private static final java.lang.String g_d
private static final java.lang.String g_t
private static final java.lang.String g_e
private static final java.lang.String g_e_f2
private static final java.lang.String[] g_all
private static final java.lang.String[] g_all_col
private static final java.lang.String[] g_all_tab
private static final java.lang.String[][] grantRevokes
public RolesConferredPrivilegesTest(java.lang.String name)
name
- Fixture namepublic static junit.framework.Test suite()
private static junit.framework.Test makeSuite()
public void atestConferredPrivileges() throws java.sql.SQLException
java.sql.SQLException
public void testViewInvalidation() throws java.sql.SQLException
java.sql.SQLException
public void testTriggerInvalidation() throws java.sql.SQLException
java.sql.SQLException
testViewInvalidation()
public void testConstraintInvalidation() throws java.sql.SQLException
java.sql.SQLException
testViewInvalidation()
public void testMinimumSelectPrivilege() throws java.sql.SQLException
java.sql.SQLException
public void testPSInvalidation() throws java.sql.SQLException
java.sql.SQLException
public void testOpenRs() throws java.sql.SQLException
java.sql.SQLException
public void testDefaultCurrentRole() throws java.sql.SQLException
java.sql.SQLException
public void testCurrentRoleInWeirdContexts() throws java.sql.SQLException
java.sql.SQLException
public static int s1f1()
private void assertAllforRole(int hasPrivilege, java.sql.Connection c, java.lang.String grantee) throws java.sql.SQLException
java.sql.SQLException
private void assertEverything(int hasPrivilege, java.lang.String user, java.lang.String role) throws java.sql.SQLException
java.sql.SQLException
private void assertEverything(int hasPrivilege, java.sql.Connection c, java.lang.String role) throws java.sql.SQLException
java.sql.SQLException
private void assertExecutePrivilege(int hasPrivilege, java.lang.String user, java.lang.String role, java.lang.String schema, java.lang.String function) throws java.sql.SQLException
hasPrivilege
- whether or not the user has the privilegeuser
- the user to checkrole
- to use, or null if we do not want to set the roleschema
- the schema to checkfunction
- the name of the function to checkjava.sql.SQLException
- throws all exceptionsprivate void assertExecutePrivilege(int hasPrivilege, java.sql.Connection c, java.lang.String schema, java.lang.String function) throws java.sql.SQLException
hasPrivilege
- whether or not the user has the privilegec
- connection to useschema
- the schema to checkfunction
- the name of the function to checkjava.sql.SQLException
- throws all exceptionsprivate void assertTriggerPrivilege(int hasPrivilege, java.lang.String user, java.lang.String role, java.lang.String schema, java.lang.String table) throws java.sql.SQLException
hasPrivilege
- whether or not the user has the privilegeuser
- the user to checkrole
- to use, or null if we do not want to set the roleschema
- the schema to checktable
- the name of the table to checkjava.sql.SQLException
- throws all exceptionsprivate void assertTriggerPrivilege(int hasPrivilege, java.sql.Connection c, java.lang.String schema, java.lang.String table) throws java.sql.SQLException
hasPrivilege
- whether or not the user has the privilegec
- connection to useschema
- the schema to checktable
- the table to checkjava.sql.SQLException
- throws all exceptionsprivate void assertReferencesPrivilege(int hasPrivilege, java.lang.String user, java.lang.String role, java.lang.String schema, java.lang.String table, java.lang.String[] columns) throws java.sql.SQLException
hasPrivilege
- whether or not the user has the privilegeuser
- the user to checkrole
- to use, or null if we do not want to set the roleschema
- the schema to checktable
- the name of the table to checkcolumns
- the name of the columns to check, or nulljava.sql.SQLException
- throws all exceptionsprivate void assertReferencesPrivilege(int hasPrivilege, java.sql.Connection c, java.lang.String schema, java.lang.String table, java.lang.String[] columns) throws java.sql.SQLException
hasPrivilege
- whether or not the user has the privilegec
- connection to useschema
- the schema to checktable
- the table to checkcolumns
- the set of columns to checkjava.sql.SQLException
- throws all exceptionsprivate void assertUpdatePrivilege(int hasPrivilege, java.lang.String user, java.lang.String role, java.lang.String schema, java.lang.String table, java.lang.String[] columns) throws java.sql.SQLException
hasPrivilege
- whether or not the user has the privilegeuser
- the user to checkrole
- to use, or null if we do not want to set the roleschema
- the schema to checktable
- the name of the table to checkcolumns
- the name of the columns to check, or nulljava.sql.SQLException
- throws all exceptionsprivate void assertUpdatePrivilege(int hasPrivilege, java.sql.Connection c, java.lang.String schema, java.lang.String table, java.lang.String[] columns) throws java.sql.SQLException
hasPrivilege
- whether or not the user has the privilegec
- connection to useschema
- the schema to checktable
- the table to checkcolumns
- the set of columns to checkjava.sql.SQLException
- throws all exceptionsprivate void assertInsertPrivilege(int hasPrivilege, java.lang.String user, java.lang.String role, java.lang.String schema, java.lang.String table, java.lang.String[] columns) throws java.sql.SQLException
hasPrivilege
- whether or not the user has the privilegeuser
- the user to checkrole
- to use, or null if we do not want to set the roleschema
- the schema to checktable
- the name of the table to checkcolumns
- the name of the columns to check, or nulljava.sql.SQLException
- throws all exceptionsprivate void assertInsertPrivilege(int hasPrivilege, java.sql.Connection c, java.lang.String schema, java.lang.String table, java.lang.String[] columns) throws java.sql.SQLException
hasPrivilege
- whether or not the user has the privilegec
- connection to useschema
- the schema to checktable
- the table to checkcolumns
- the set of columns to checkjava.sql.SQLException
- throws all exceptionsprivate void assertSelectPrivilege(int hasPrivilege, java.lang.String user, java.lang.String role, java.lang.String schema, java.lang.String table, java.lang.String[] columns) throws java.sql.SQLException
hasPrivilege
- whether or not the user has the privilegeuser
- the user to checkrole
- to use, or null if we do not want to set the roleschema
- the schema to checktable
- the name of the table to checkcolumns
- the name of the columns to check, or nulljava.sql.SQLException
- throws all exceptionsprivate void assertSelectPrivilege(int hasPrivilege, java.sql.Connection c, java.lang.String schema, java.lang.String table, java.lang.String[] columns) throws java.sql.SQLException
hasPrivilege
- whether or not the user has the privilegec
- connection to useschema
- the schema to checktable
- the table to checkcolumns
- the set of columns to checkjava.sql.SQLException
- throws all exceptionsprivate void assertSelectCountPrivilege(int hasPrivilege, java.sql.Connection c, java.lang.String schema, java.lang.String table, java.lang.String[] columns, java.lang.String sqlState) throws java.sql.SQLException
hasPrivilege
- whether or not the user has the privilegec
- connection to useschema
- the schema to checktable
- the table to checkcolumns
- used for error handling if ran into exceptionsqlState
- expected state if hasPrivilege == NOPRIVjava.sql.SQLException
- throws all exceptionsprivate void assertSelectConstantPrivilege(int hasPrivilege, java.sql.Connection c, java.lang.String schema, java.lang.String table, java.lang.String sqlState) throws java.sql.SQLException
hasPrivilege
- whether or not the user has the privilegec
- connection to useschema
- the schema to checktable
- the table to checksqlState
- expected state if hasPrivilege == NOPRIVjava.sql.SQLException
- throws all exceptionsprivate void assertSelectPrivilege(int hasPrivilege, java.sql.Connection c, java.lang.String schema, java.lang.String table, java.lang.String[] columns, java.lang.String sqlState) throws java.sql.SQLException
hasPrivilege
- whether or not the user has the privilegec
- connection to useschema
- the schema to checktable
- the table to checkcolumns
- the set of columns to checksqlState
- expected state if hasPrivilege == NOPRIVjava.sql.SQLException
- throws all exceptionsprivate void assertViewExists(boolean exists, java.sql.Connection c, java.lang.String table) throws java.sql.SQLException
java.sql.SQLException
private void assertTriggerExists(boolean exists, java.sql.Connection c, java.lang.String trigger) throws java.sql.SQLException
java.sql.SQLException
private void assertFkConstraintExists(boolean exists, java.sql.Connection c, java.lang.String table) throws java.sql.SQLException
java.sql.SQLException
private void assertCheckConstraintExists(boolean exists, java.sql.Connection c, java.lang.String table) throws java.sql.SQLException
java.sql.SQLException
private void assertConstraintExists(boolean exists, java.sql.Connection c, java.lang.String table, java.lang.String sqlState) throws java.sql.SQLException
java.sql.SQLException
private void assertPsWorks(boolean works, java.sql.PreparedStatement ps) throws java.sql.SQLException
java.sql.SQLException
private void assertDeletePrivilege(int hasPrivilege, java.lang.String user, java.lang.String role, java.lang.String schema, java.lang.String table) throws java.sql.SQLException
hasPrivilege
- whether or not the user has the privilegeuser
- the user to checkrole
- to use, or null if we do not want to set the roleschema
- the schema to checktable
- the name of the table to checkjava.sql.SQLException
- throws all exceptionsprivate void assertDeletePrivilege(int hasPrivilege, java.sql.Connection c, java.lang.String schema, java.lang.String table) throws java.sql.SQLException
hasPrivilege
- whether or not the user has the privilegec
- connection to useschema
- the schema to checktable
- the table to checkjava.sql.SQLException
- throws all exceptionsprivate void assertPrivilegeMetadata(int hasPrivilege, java.sql.Connection c, java.lang.String type, java.lang.String schema, java.lang.String table, java.lang.String[] columns) throws java.sql.SQLException
hasPrivilege
- Is != NOPRIV if we expect the caller to have the
privilegec
- user connectiontype
- type of privilege, e.g. SELECT, INSERT, DELETE, etc.schema
- the schema to checktable
- the table to checkcolumns
- the set of columns to check, or all columns if nulljava.sql.SQLException
private boolean isOwner(java.lang.String schema, java.lang.String user) throws java.sql.SQLException
java.sql.SQLException
private java.lang.String[] getAllColumns(java.lang.String schema, java.lang.String table) throws java.sql.SQLException
java.sql.SQLException
private static java.lang.String columnListAsString(java.lang.String[] columns)
columns
- an array of columns to formatprivate static java.lang.String formatArgs(java.sql.Connection c, java.lang.String schema, java.lang.String table, java.lang.String[] columns) throws java.sql.SQLException
java.sql.SQLException
private static java.lang.String formatArgs(java.sql.Connection c, java.lang.String schema, java.lang.String dbObject) throws java.sql.SQLException
java.sql.SQLException
private void setRole(java.sql.Connection c, java.lang.String role) throws java.sql.SQLException
java.sql.SQLException
private void doGrantRevoke(int action, java.lang.String grantor, java.lang.String[] actionStrings, java.lang.String grantee, java.lang.String[] warningExpected) throws java.sql.SQLException
java.sql.SQLException
private void doGrantRevoke(int action, java.lang.String grantor, java.lang.String[] actionStrings, java.lang.String grantee) throws java.sql.SQLException
java.sql.SQLException
private void doGrantRevoke(int action, java.lang.String grantor, java.lang.String actionString, java.lang.String grantee, java.lang.String warningExpected) throws java.sql.SQLException
java.sql.SQLException
private void doGrantRevoke(int action, java.lang.String grantor, java.lang.String actionString, java.lang.String grantee) throws java.sql.SQLException
java.sql.SQLException
private java.lang.String CNFUser2user(java.lang.String CNFUser)
private void assertSQLState(java.lang.String[] ok_states, java.sql.SQLException e)
public static void calledNested() throws java.sql.SQLException
java.sql.SQLException
public static java.lang.String getCurrentRole() throws java.sql.SQLException
java.sql.SQLException
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.