Here's a cheat sheet for including Java stored procedures in packages.
Write a class:
public class OracleFoo {
public static void myproc(int port, String s) throws Exception {
}
}
Compile and Load:
javac OracleFoo.java
loadjava -u scott/tiger OracleFoo.class
Declare a package:
create or replace package oraclefoo
as
procedure myproc(port number, s varchar2)
as language java name 'OracleFoo.myproc(int, java.lang.String)';
end;
Call:
begin
oracletbslow.myproc(7728,'[1,"a","b1",{}]');
oracletbslow.myproc(7727,'[1,"a","b2",{}]');
end;
Permissions:
need to set these, double-check notes...
public class OracleFoo {
public static void myproc(int port, String s) throws Exception {
}
}
Compile and Load:
javac OracleFoo.java
loadjava -u scott/tiger OracleFoo.class
Declare a package:
create or replace package oraclefoo
as
procedure myproc(port number, s varchar2)
as language java name 'OracleFoo.myproc(int, java.lang.String)';
end;
Call:
begin
oracletbslow.myproc(7728,'[1,"a","b1",{}]');
oracletbslow.myproc(7727,'[1,"a","b2",{}]');
end;
Permissions:
need to set these, double-check notes...