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 "<function-name>" 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.
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 "<function-name>" 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.