Oracle Java Stored Procedure + package Invocation

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.