-1

I have one jar in oracle database and i want to call that jar and send some parameters to the main class function

    public getOffer(String name 1,String name2){

    } // function that in main class in jar 

how to implement this. Waiting for helpful replies Thanks in advance guys.

SURJA
  • 17
  • 7
  • Don't just repeat the same question over and over again. Improve the first one insted. http://stackoverflow.com/questions/17021844/sending-parameter-to-main-class-function-in-jar – maba Jun 10 '13 at 11:39

2 Answers2

0

import that jar in your program and create object of that class and simple call that method by object.methodname and necessary parameter that methods required

shreyansh jogi
  • 2,082
  • 12
  • 20
0

To call a Java method inside the oracle database you have to make this method static (like a main(String[]) method.

After that you have to create a PL/SQL-wrapper:

create or replace function get_offer(name1 in varchar2, name2 in varchar2) return varchar2
is language java name 'MyClass.getOffer(java.lang.String,java.lang.String) return java.lang.String';
/

See also the Oracle Documention.

Uwe Plonus
  • 9,803
  • 4
  • 41
  • 48
  • but main class is in jar and this jar in oracle database. so This wrapper will work ? – SURJA Jun 10 '13 at 11:52
  • @SURJA I you loaded the jar with `loadjar` it works. – Uwe Plonus Jun 10 '13 at 12:09
  • Thanks Uwe Plonus , i will try thanks again and please give me some shortcut description or any link about how to load jar using loadjar and please mail me u r email id to srdeshmukh786@gmail.com to make some work deal – SURJA Jun 10 '13 at 12:17
  • @SURJA Please follow the link to the Oracle documetation I gave in my answer. – Uwe Plonus Jun 10 '13 at 12:18
  • i read the given oracle documentation but there is no any loadjar , there is a loadjava so will it work if i will use loadjava to load jar file into oracle database – SURJA Jun 13 '13 at 18:14
  • @SURJA I meant `loadjava`. – Uwe Plonus Jun 14 '13 at 05:51
  • thanks, if the main jar contains another jar then how i will write the loadjava , i read oracle documentation but i m confused..Thanks in advance – SURJA Jun 14 '13 at 07:22