1、定义一个sql 类Hello
DROP JAVA SOURCE NEWXZXT."Hello"; CREATE OR REPLACE AND RESOLVE JAVA SOURCE NAMED NEWXZXT."Hello" as import java.lang.*; public class Hello { public static String say(String args) { System.out.println(args); return args; } } /
2、存储过程调用上面的sql类
CREATE OR REPLACE procedure NEWXZXT.prc_hehe ( p_name VARCHAR2 ) as language java name ‘Hello.say(java.lang.String)‘; /
3、调用存储过程
set serveroutput on; call prc_hehe(‘test ok!‘); call dbms_java.set_output(5000); call prc_hehe(‘test ok!‘);
时间: 2024-10-16 13:18:58