1. Create a Java Stored Procedure
Create or replace and compile Java source named "Testhello" Aspublic class testhello{public static void Test () {Syste M.out.println ("Hello"); }}
2. Create a JSP call stored or method (this example is saved in a package creation)
Create or Replace package pkg_test are procedure do_test;end pkg_test;/create or replace package body Pkg_test is procedu Re do_test as language Java name ' testhello.test () '; Begin Null;end pkg_test;/
3. Call in the command window to redirect System.out to the current window with the following command
Sql> set Serveroutput onsql> call Dbms_java.set_output (5000); Method calledsql> exec pkg_test.do_test; Hellopl/sql procedure successfully completed
This article is from the "Techrunner" blog, make sure to keep this source http://pierre.blog.51cto.com/9295298/1629608
Oracle Java Stored Procedure + package Invocation