Home » Developer & Programmer » JDeveloper, Java & XML » how to call java from stored procedure? (10g on windows 2003 server)
how to call java from stored procedure? [message #332398] Tue, 08 July 2008 07:56 Go to next message
kang
Messages: 89
Registered: November 2007
Member
how to call java from stored procedure?
and where the java program(.class) should be located?
say InsertData.java.

class InsertData{
public static void main(String[] args){
// some insert jobs
}
}
Re: how to call java from stored procedure? [message #332405 is a reply to message #332398] Tue, 08 July 2008 08:11 Go to previous messageGo to next message
Michel Cadot
Messages: 68716
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
CREATE JAVA and follow the links.

Regards
Michel
Re: how to call java from stored procedure? [message #338061 is a reply to message #332398] Sat, 02 August 2008 21:40 Go to previous messageGo to next message
Kevin Meade
Messages: 2103
Registered: December 1999
Location: Connecticut USA
Senior Member
Michel, correct me here if I get it wrong please.

If I remember correctly, to call java from plsql, you don't.

What you do is create a plsql specification that maps to the java procedure. This effectively renames the java procedure and makes it look like a plsql procedure. then you call the plsql specification.

Do a google for this stuff, that is how I learned it. For example, I found this in three seconds...


9.8 Publishing and Using Java in PL/SQL

 standalone function calling a method:

CREATE OR REPLACE FUNCTION fDelete (
   file IN VARCHAR2) 
   RETURN NUMBER
AS LANGUAGE JAVA
   NAME 'JDelete.delete (
            java.lang.String) 
            return int';


Good luck, Kevin
Re: how to call java from stored procedure? [message #338073 is a reply to message #338061] Sun, 03 August 2008 01:56 Go to previous messageGo to next message
Michel Cadot
Messages: 68716
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Quote:
If I remember correctly, to call java from plsql, you don't.

What you do is create a plsql specification that maps to the java procedure.

You are perfectly right.
I did it short posting the link to the create java section as it itself points to the relevant documentation, among them Database Java Developer's Guide, Chapter 3 Calling Java Methods in Oracle Database

Regards
Michel
Re: how to call java from stored procedure? [message #338128 is a reply to message #338073] Sun, 03 August 2008 21:58 Go to previous message
Kevin Meade
Messages: 2103
Registered: December 1999
Location: Connecticut USA
Senior Member
Thanks for the confirm. Kevin
Previous Topic: inserting xml file into oracle database table
Next Topic: java.lang.incombatible class change error
Goto Forum:
  


Current Time: Thu Nov 21 16:41:49 CST 2024