Sunday, January 2, 2011

Java stored procedure in Oracle

Recently, i got a very interesting project from a client. The guy wanted me to write a script which is fired at specific instances and sends SMS to the users. The interesting part was that neither the source code of the front-end application was available nor the interface. Only one thing was given and that was the database (now it's funny for me to see a person thinking that it's not safe to give the source code of the front-end and yet give database.. but clients are this way sometimes) .. So, i thought that the only approach left is to use Oracle triggers but obviously, one can't send SMS using SQL (atleast not using any method that i know of). So, I thought of using Java stored procedure and calling the procedure from a trigger. Not many people know about this functionality of Oracle that it allows you to write a stored procedure purely in Java language and embed that in the Oracle DB.
For the time being, I am sharing a couple of very nice and easy to learn tutorials on this particular topic. I'll try to write a tutorial on this myself if i get time.

http://www.developer.com/db/article.php/3337411/Oracle-and-Java-Stored-Procedures.htm
http://download.oracle.com/docs/html/A95261_01/jdgtut1.htm

No comments:

Post a Comment