Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Calling Java from Oracle ?

Re: Calling Java from Oracle ?

From: <clint.scott_at_bosquenetwerks.com>
Date: Thu, 08 Jul 1999 13:36:03 GMT
Message-ID: <7m29g2$b9s$1@nnrp1.deja.com>


In article
<Pine.BSF.4.10.9907081125510.95297-100000_at_dream.club-internet.fr>,   Emmanuel BOURG <smanux_at_dream.club-internet.fr> wrote:
> Hello,
>
> Is it possible to use Java code in Oracle functions ? Is there
something
> equivalent for Java to external call of C/C++ functions in DLLs ?
>
> I have been brainstorming on this issue for 3 days ;) If someone has
the
> solution I would be *very* interested :)
>
> Thanks
>
> Emmanuel BOURG
>
>

There are two ways to do this in Oracle: DBMS_PIPE or External Functions. The External Functions will not work because, in essence, you create a shared, compiled object (.so in Unix) which will be called by the External Functions Agent. The DBMS_PIPE will/does work. Here is how to do it:
Create a PL/SQL stored procedure which will create a named DBMS_PIPE. put a message in it and send it.
Create another PL/SQL stored procedure which will open the named pipe and read it.
In Java, create a method within a class which executes the second stored procedure (use the JDBC CallableStatment). If you put the jdbc methods in a loop, the Java method will receive the messages on the pipe anytime the first stored procedure puts a mesasge on it. This is very fast and very cool.
I hope this makes sense. If not, drop me an email for a better explanation.

clint

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't. Received on Thu Jul 08 1999 - 08:36:03 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US