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?