1

我需要使用dbms_java.loadjava方法在 Oracle RDBMS 中上传 jar 文件。我已授予所有必需的权限,并且能够成功运行以下功能。

create or replace function get_java_property(prop in varchar2)
return varchar2 is
language java name 'java.lang.System.getProperty(java.lang.String) return java.lang.String';

select get_java_property('java.version') from dual;

1.8.0_231

但是,我还需要上传一个外部 jar 并使用它。loadjava通过将 jar 放在 Oracle Server 上并运行命令,我可以成功地做到这一点。但是我想dbms_java.loadjava从我的本地系统做同样的事情。我正在尝试以下查询。

call dbms_java.loadjava('–proxy -Dhttp.proxyHost=my_local_system_ip -Dhttp.proxyPort=22 file:///home/Documents/abc.jar');

它返回Call completed.但是,jar 没有上传,因为我试图访问 Jar 中的方法并出现错误

ORA-29540: class com/pkg_name/function_name does not exist
29540. 00000 -  "class %s does not exist"  
*Cause:    Java method execution failed to find a class with the indicated name.
*Action:   Correct the name or add the missing Java class.

loadjava但是,当通过命令上传 jar 时,可以使用相同的方法。请建议。可能是我缺少一些基础知识。

4

0 回答 0