Application client as Java Stored Procedure [message #119298] |
Wed, 11 May 2005 12:09 |
proving_grounds
Messages: 3 Registered: May 2005 Location: Barcelona
|
Junior Member |
|
|
Hello!
I've loaded an OC4J application client as Java Stored Procedures with loadjava, into an Oracle9i, and now it's available to PL/SQL procedures.
The problem appears when I invoke my Java code, with some JNDI stuff, from PL/SQL. It says cannot instantiate RMIInitialContextFactory (because it's not loaded into the database).
Can I avoid load all OC4J related jars in order to make my code work? Is there some compact version or I have to load oc4j.jar and listed jars on Manifest.mf? Is there some way to configure Oracle to see OC4J classpath externally (not loading jars)?
Thank you in advance,
Eva.
|
|
|
|
Re: Application client as Java Stored Procedure [message #130561 is a reply to message #130461] |
Mon, 01 August 2005 01:47 |
proving_grounds
Messages: 3 Registered: May 2005 Location: Barcelona
|
Junior Member |
|
|
I found a solution, but it was a little 'sui generis'.
The solution was to create a simple Java class with some methods that were the interface to call Java from PL/SQL and a method that called another class with a system call. This simple class didn't need any jar, so it was easy to load to Oracle.
The call to the external class was done with a system call 'java -classpath your_classpath foo.bar.Class'. foo.bar.Class was external to Oracle, but accesible to Oracle's user in the operative system. That class did the logic that needed all those jars configured in classpath. To return some result to the calling class it was done throw System.out, wich you can pick up with Process' method getInputStream().
I know it's not a general solution, perhaps not the most appropiate, but with my problem it worked ok.
|
|
|