DatabaseMetaData.getTablePrivileges

DatabaseMetaData.getTablePrivileges

Interface Overview | Interface Members | This Package | All Packages

Syntax
public abstract ResultSet getTablePrivileges( String catalog, String schemaPattern, String tableNamePattern ) throws SQLException
Parameters
catalog
a catalog name; "" retrieves those without a catalog; null means drop catalog name from the selection criteria
schemaPattern
a schema name pattern; "" retrieves those without a schema
tableNamePattern
a table name pattern
Returns
ResultSet - each row is a table privilege description
Description
Get a description of the access rights for each table available in a catalog. Note that a table privilege applies to one or more columns in the table. It would be wrong to assume that this priviledge applies to all columns (this may be true for some systems but is not true for all.)

Only privileges matching the schema and table name criteria are returned. They are ordered by TABLE_SCHEM, TABLE_NAME, and PRIVILEGE.

Each privilige description has the following columns:

  1. TABLE_CAT String => table catalog (may be null)
  2. TABLE_SCHEM String => table schema (may be null)
  3. TABLE_NAME String => table name
  4. GRANTOR => grantor of access (may be null)
  5. GRANTEE String => grantee of access
  6. PRIVILEGE String => name of access (SELECT, INSERT, UPDATE, REFRENCES, ...)
  7. IS_GRANTABLE String => "YES" if grantee is permitted to grant to others; "NO" if not; null if unknown

Exceptions
SQLException if a database-access error occurs.
See Also
getSearchStringEscape