1. 创建Java Stored Procedure
create or replace and compile java source named "TestHello" aspublic class TestHello{ public static void test(){ System.out.println("Hello"); }}
2.创建JSP调用存过或方法(本例为在包创建的存过)
create or replace package pkg_test is procedure do_Test;end pkg_test;/create or replace package body pkg_test is procedure do_Test as language java name 'TestHello.test()';begin null;end pkg_test;/
3.在命令窗口调用,通过如下命令使System.out重定向到当前窗口
SQL> set serveroutput onSQL> call dbms_java.set_output(5000);Method calledSQL> exec pkg_test.do_Test;HelloPL/SQL procedure successfully completed