1、创建一个java存储过程helloworld
create or replace and compile java source named helloworld
as
public class helloworld{
public static void main(String[] args){
System.out.println("hello");
}
}
/
如果已有class文件,则可以用
create or replace java class using bfile('c:/','helloworld.class')
/
2、创建相应的proc
create or replace procedure helloworld
as language java
name 'helloworld.main(java.lang.String[])';
/
3、调用dbms_java.set_output
SQL> set serveroutput on size 5000
SQL> call dbms_java.set_output(5000);
4、调用过程显示结果
sql>execute helloworld;
sql>call helloworld();