Note
This view is available starting with V4.6.3.
Overview
The USER_JAVA_POLICY view displays the Java privilege policy of the currently logged-in user, including the privilege granting and restriction rules for Java UDFs.
Difference from the DBA_JAVA_POLICY view: The DBA_JAVA_POLICY view displays the Java permission policy for all users in the current tenant, while the USER_JAVA_POLICY view displays only the permission policy records related to the currently logged-in user.
Columns
Field Name |
Type |
Whether can be NULL |
Description |
|---|---|---|---|
| KIND | varchar(8) | NO | Policy type:
|
| GRANTEE | varchar(128) | NO | The authorized username. |
| TYPE_SCHEMA | varchar(128) | NO | The name of the database to which the type belongs. |
| TYPE_NAME | varchar(4096) | YES | Type name. |
| NAME | varchar(4096) | YES | The name of the permission target. |
| ACTION | varchar(4096) | YES | Permission action. |
| ENABLED | varchar(8) | NO | Whether the policy is enabled:
|
| SEQ | bigint(20) | NO | Policy ID. |
Sample query
Query the Java permission policy of the currently logged-in user.
SELECT * FROM oceanbase.USER_JAVA_POLICY;
The query result is as follows:
+------+---------+--------------+------------------------+--------+--------+---------+------+
| KIND | GRANTEE | TYPE_SCHEMA | TYPE_NAME | NAME | ACTION | ENABLED | SEQ |
+------+---------+--------------+------------------------+--------+--------+---------+------+
| GRANT| SYS | java.io | FilePermission | /tmp/- | read | ENABLED | 1 |
+------+---------+--------------+------------------------+--------+--------+---------+------+
1 row in set
References
- DBA_JAVA_POLICY: Displays the Java permission policy for all users in the current tenant.
- For more information about Java UDFs and the
DBMS_JAVAsystem package, see Overview of DBMS_JAVA. - For information about how to enable the Java UDF sandbox mode, see ob_enable_java_udf_sandbox.