SecurityException when trying to export a java resource
I'm trying to get the source of a java resource stored in an oracle database using this code (connecting as SYSTEM for testing):
DECLARE
javalob CLOB;
BEGIN
DBMS_LOB.CREATETEMPORARY(javalob, false);
DBMS_JAVA.EXPORT_RESOURCE('RESOURCENAME', 'SCHEMA', javalob);
DBMS_OUTPUT.PUT_LINE(javalob);
END;
But when I try to run it I get this:
Java call terminated by uncaught Java exception: java.lang.SecurityException: cannot read <Resource Handle: RESOURCENAME|SCHEMA|301> because SYSTEM does not have开发者_如何学运维 execute privilege on it
This thing is, I'm not sure how to grant permissions on <Resource Handle: RESOURCENAME|SCHEMA|301>
, as this isn't a SQL or PL/SQL object. And why doesn't SYSTEM have access to it anyway?
the procedure below in dbms_java package may solve your problem:
PROCEDURE grant_permission(
grantee varchar2,
permission_type varchar2,
permission_name varchar2,
permission_action varchar2)
http://download.oracle.com/docs/cd/B14117_01/java.101/b12021/security.htm#i1005789
精彩评论