Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Java Stored Procs in 8.i
Hello,
I'm just getting started with using Java stored procs in 8.i, and am having a bit of trouble. What I'm trying to do is:
public class MyClass {
public static void GetInfo(String[] output) {
String s = SomeFunctionReturningString(); // etc.
output[0] = s;
}
}
2. Publish it like this:
create or replace procedure MyProc(parm1 OUT VARCHAR2) as language java name 'MyClass.GetInfo(java.lang.String[])';
3. To test it, I run the following commands in SQL*Plus:
> var test varchar2;
> exec MyProc(:test);
> print :test;
The problem is with the type of the parameter I'm passing to the Java method. When I pass a string array, the procedure executes, but the output is always a blank string (And I KNOW that SomeFunctionReturningString() above is returning a non-blank string). If I specify an array of characters (or StringBuffers), I get an "inconsistent datatypes" error message from SQL*Plus. I have to be able to pass multiple parameters in and have them be modified on return from the Java method, so changing the above sample code to be a function returning the desired value is not really an option. Does anyone have any suggestions about this? I'd be most appreciative of any suggestions.
Thanks,
Kelly
jkelly_at_kcnet_dot_com Received on Mon Aug 28 2000 - 20:51:40 CDT