在Oracle中设置Java存储过程的类路径 [英] Setting classpath for a Java stored procedure in Oracle
问题描述
我有一个Oracle 10g数据库,我有一个第三方jar文件。我希望能够在我的数据库中运行SQL select查询,该查询最终在我的第三方库中运行代码以检索包含在SQL结果集中的信息。我看到很多关于Java存储过程的教程,这些似乎是一种很有前途的方法,但似乎没有人使用第三方库,我似乎无法弄清楚如何为我的jar指定类路径我在Oracle中运行时将识别的文件。我该怎么做?
I've got an Oracle 10g database, and I have a third-party jar file. I want to be able to run a SQL select query in my database that ultimately runs code in my third-party library to retrieve info for inclusion in a SQL result set. I see lots of tutorials on "Java stored procedures" and these seem to be a promising way to do this, but none seem to use third-party libraries, and I can't seem to figure out how to specify a classpath for my jar file that will be recognized when I am running in Oracle. How can I do this?
推荐答案
您可以使用loadjava工具将JAR文件加载到数据库中。
此工具还接受.class,.java,.properties,.sqlj,.ser,.jar或.zip文件。
You can load the JAR file into the database using the loadjava tool. This tool accepts also .class, .java, .properties, .sqlj, .ser, .jar, or .zip files.
参见手册( http://docs.oracle.com/cd/B19306_01/java.102/b14187/cheleven.htm#CACFHDJE )了解更多信息。
See the manual ( http://docs.oracle.com/cd/B19306_01/java.102/b14187/cheleven.htm#CACFHDJE ) for more information.
这篇关于在Oracle中设置Java存储过程的类路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!