简体   繁体   English

通过名称将在嵌入式Oracle JVM中运行的Java授予Oracle目录的等效语法是什么?

[英]What is the equivalent syntax to grant Java running in the embedded Oracle JVM to an Oracle Directory by Name?

To grant java code that is running inside the Oracle JVM built into 10g DBMS to a specific directory on disk I can can execute: 要将10g DBMS内置的Oracle JVM中运行的Java代码授予磁盘上的特定目录,我可以执行以下命令:

dbms_java.grant_permission( 
        'SCOTT', 
        'SYS:java.io.FilePermission', 
        '/some/path/on/disk', 
         'read');

What is the equivalent syntax to grant Java code running inside the Oracle JVM built into 10g DBMS an Oracle Directory by Name? 授予在10g DBMS内置的Oracle JVM中运行的Java代码的Oracle目录名称的等效语法是什么?

dbms_java.grant_permission( 'SCOTT', 
 'SYS:java.io.FilePermission', 
 'SOME_DIRECTORY_IN_ALL_DIRECTORIES_VIEW', 
 'read');

The directory objects can be found here: select * from all_directories 可以在这里找到目录对象:从all_directories中选择*

Example entries in all_directories view: all_directories视图中的示例条目:

OWNER   DIRECTORY_NAME    DIRECTORY_PATH
SYS     LOG               /export/home/scott/log
SYS     RESPONSE          /export/home/scott/response
SYS     STAGING           /export/home/scott/staging

If there is such a beast, What is the syntax to read from the named directory within the Java code? 如果有这样的野兽,那么从Java代码中的命名目录读取的语法是什么?

Based on what I read in this AskTom question , you'll need something like: 根据我在AskTom问题中阅读的内容 ,您将需要以下内容:

SELECT directory_path INTO v_path
  FROM all_directories
 WHERE directory_name = '<oracle_dir_name>';

dbms_java.grant_permission( 'SCOTT', 
 'SYS:java.io.FilePermission', 
 v_path, 
 'read');

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM