第一步:创建java source
create or replace and compile java source named Hello
as
public class Hello{
public static void run(){
System.out.println("slc testing...");
}
}
第二步:编辑存储过程
create or replace procedure run_hello
as language java
name 'Hello.run()';
第三步:设置pl sql pluse
PL/SQL procedure successfully completed
SQL> set serveroutput on size 5000;
SQL> call dbms_java.set_output(5000);
Method called
第四步:运行存储过程
SQL> exec run_hello;
slc testing...
PL/SQL procedure successfully completed
SQL>