Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

java JAR stored procedures with DB2

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I'm having problems running stored procedures in DB2 v7.2. They are created in Java Language. I've always run them in a very simple way, registering them with CREATE PROCEDURE...
and having the code in a .class file. Now I need to run them from a Jar file. I install this JAR executing the following command in the DB2 command center:

CALL SQLJ.INSTALL_JAR ('file:/us/tlpb/MTBJ_MANT.jar', 'MTBJ_MANT.jar')
I have no problems, and the following structure is created:

/DB2/db2inst1/sqllib/function/jar/MTBJ_MANT

and inside MTBJ_MANT directory the file JAR.jar is created

Then I try to register it writing this:
CREATE PROCEDURE MTBJ_MANT( in ID_CODENT28 int,
in ID_MOTBAJA28 int,
in CDESMOT28 char(30),
in CDESMOTRED char(10),
in nModo int,
in CQUEQUEO_TST28 char(40),
in CQUEQUEO_NUEVO char(40))
EXTERNAL NAME 'JAR:MTBJ_MANT.Ejecutar'
LANGUAGE JAVA
PARAMETER STYLE JAVA

but I always get the same message:
SQL20204N The user defined function or procedure &quot;<function-name>&quot; was unable to map to a single Java method.
Explanation: The identified function or procedure either failed to find a matching Java method, or found more than 1 matching Java method.
User Response: Correct either the Java method or corresponding create statement so that the function or procedure call resolves to a single Java method.

For some reason DB2 is not getting the path in which the JAR is installed.
is anybody got a clue? Thanks.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top