toad调用存储过程,存储过程调用sql 类

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!');

  

posted @ 2016-01-21 17:58  啊朋  阅读(1425)  评论(0编辑  收藏  举报