Oracle Java Stored Procedure + 包调用
1. 创建Java Stored Procedure
create or replace and compile java source named "TestHello" as public 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 on SQL> call dbms_java.set_output(5000); Method called SQL> exec pkg_test.do_Test; Hello PL/SQL procedure successfully completed
本文出自 “TechRunner” 博客,请务必保留此出处http://pierre.blog.51cto.com/9295298/1629608
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。