Calling JAVA code from Oracle
To run java code from oracle do the following:
1. Create the java code on the server:
CREATE OR REPLACE AND COMPILE JAVA SOURCE NAMED "hello" AS
public class hello {
public static String world() {
return "Hello World";
}
}
/
2. Create the oracle function on the server:
CREATE OR REPLACE FUNCTION hellofunction RETURN VARCHAR2 AS
LANGUAGE JAVA NAME 'hello.world() return java.lang.String';
/
3. Call the function using a SELECT:
SELECT hellofunction() from DUAL;
on March 19th, 2006 at 5:20 pm
/kick #rami.info rami
/ban rami
on March 19th, 2006 at 9:53 pm
I second Mark, I mean I am getting nothing from here other than those weird thingys :/
on March 20th, 2006 at 9:04 am
Oh comeon guys! If I don’t post stuff like that then where else would you get this information from? :) Plus that’s better than posting nude pictures like some people do ;)
on March 20th, 2006 at 1:52 pm
lol.
on March 24th, 2006 at 9:38 am
it’s a good informaion , you should make some fees over it ;)_
on May 9th, 2006 at 12:01 am
Too geeky for them rami ;)
You could run PHP code from PostgreSQL as well. And in MSSQL server 2005, you could run .Net code (any registered language in the framework) too ;)
I don’t think this feature would be cool to use unless you’re on heavly load transaction and PL/SQL based data transfer and queries that melt servers, other than that, triggers are enought to return some procedure call values.
on May 11th, 2006 at 5:33 pm
Hehehe! As I was goin’ through the blog Rami, I thought, this guy can make xtra bucks tutoring people – think of that! You get the info, Pearls do translation when required (besides backing her hubby) and I will handle marketing your “commercial name” , how ‘bout that ?!