Thursday, October 16, 2008

Oracle PL/SQL | Calling Java function in Oracle Procedure and Function

Use following steps:

1. Load Java Class

loadjava -user

2. Create Oracle Procedure/Function pointing to Java Function

create or replace procedure HelloWorld
as language java
name '<>'

3. Execute the procedure

Note: To map Java output to DBMS Output use:

SQL> SET SERVEROUTPUT ON SIZE 5000
SQL> CALL dbms_java.set_output(5000);

Reference: http://download.oracle.com/docs/cd/B19306_01/java.102/b14187/chthree.htm

No comments: