Oracle存储过程调用Java:
SQL> create or replace and compile java source named \"javademo1\" as
timport java.sql.*;
public class JavaDemo1 {
public static void main(String[] args) {
System.out.println(\"hello, java demo1\");
}
}
Java已创建。
SQL> show errors java source \"javademo1\"没有错误。
SQL> create or replace procedure javademo1 as language java name 'JavaDemo1.main(java.lang.String[])';
过程已创建。
SQL> set serveroutput on;
SQL> call javademo1();
SQL> set serveroutput on size 5000;
SQL> call dbms_java.set_output(5000);
调用完成。
SQL> execute javademo1;
hello, java demo1