Sunday, December 22, 2013
Java Stored Procedure in ORACLE PLSQL – A simple example
In this post, I tried the below,
- Create a simple class via PLSQL
- Verify the same in DB_OBJECTS
- Create a simple procedure to Invoke the member function of the class created above
- Test the script
- Drop the Java class created
Create
a simple class via PLSQL
CREATE OR REPLACE AND COMPILE JAVA SOURCE NAMED "HelloWorldApp" AS
class helloworldapp {
public static void
sayhello() {
system.out.println("hello world!!!
this is www.shareoracleapps.com");
}
};
Verify
the same in DB_OBJECTS
Create
a simple procedure to Invoke the member function of the class created above
CREATE OR REPLACE PROCEDURE test_hello_world
AS
LANGUAGE JAVA
NAME
'HelloWorldApp.sayHello()';
Test
the script
SET SERVEROUTPUT ON;
CALL DBMS_JAVA.set_output(2000);
CALL test_hello_world();
Drop
the Java class created
I hope this helps for beginners.
Do you think this Article is useful?
Subscribe to:
Post Comments (Atom)
Disclaimer
The ideas, thoughts and concepts expressed here are my own. They, in no way reflect those of my employer or any other organization/client that I am associated. The articles presented doesn't imply to any particular organization or client and are meant only for knowledge Sharing purpose. The articles can't be reproduced or copied without the Owner's knowledge or permission.
0 Responses to “Java Stored Procedure in ORACLE PLSQL – A simple example”
Post a Comment