views:

820

answers:

2

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?

A: 

Try adding the jar to the Windows/Unix CLASSPATH system variable.

Joshua
Is there a way I can do this without altering the machine environment?
Chris Farmer
+7  A: 

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.

See the manual ( http://esupport.csci.unt.edu/oracle/java.901/a90210/02_load.htm#27746 ) for more information.

Edwin