Hi All!
I need to implement Guid into db2 table column. Implementation of it is in external java file.
After compiling it becomes an *.jar file for instalation into db2.
But while I try to create function with external call
I get the -20204. THE USER-DEFINED FUNCTION OR PROCEDURE routine-name WAS UNABLE TO MAP TO A SINGLE JAVA METHOD mistake.
Where the mistake? Java compiled and installed without any error with jre 6 (goes with db2). Seems that db2 can't find java fuinction in imported jar-file
Os: Win 7x64
DB2: 9.7
JRE: 6
Thanks.
I need to implement Guid into db2 table column. Implementation of it is in external java file.
Code:
import java.util.UUID;
public class UUIDUDF
{
public static String randomUUID()
{
return UUID.randomUUID().toString();
}
}
Code:
call sqlj.install_jar('file:d\UUIDUDF.jar', 'UUIDUDFJAR')
Code:
CREATE OR REPLACE FUNCTION RANDOMUUID()
RETURNS VARCHAR(36)
LANGUAGE JAVA
PARAMETER STYLE JAVA
NOT DETERMINISTIC NO EXTERNAL ACTION NO SQL
EXTERNAL NAME 'UUIDUDFJAR:UUIDUDF.randomUUID' ;
Where the mistake? Java compiled and installed without any error with jre 6 (goes with db2). Seems that db2 can't find java fuinction in imported jar-file
Os: Win 7x64
DB2: 9.7
JRE: 6
Thanks.