Continuing my UDF adventure started two days ago, I have managed to get the UDF registered but having problem getting the Java code to work. I need assistance to get this Double Metaphone Java UDF to work pretty quickly. Here is what I tried to run and the error message that resulted:
select nm_frst, NM_LST, DB2ADMIN.DMPHONEJAVASCALAR(NM_LST)
WHERE NM_FRST = 'SKYLER';
SQL4304N Java stored procedure or user-defined function "DB2ADMIN.DMPHONEJAVASCALAR", specific name "DMPHONEJAVASCALAR" could not load Java class "/home/db2inst1/sqllib/fun", reason code "". SQLSTATE=42724
SQL4304N Java stored procedure or user-defined function "DB2ADMIN.DMPHONEJAVASCALAR", specific name "DMPHONEJAVASCALAR" could not load Java class "/home/db2inst1/sqllib/fun", reason code "".
The Java class given by the EXTERNAL NAME clause of a CREATE PROCEDURE or CREATE FUNCTION statement could not be loaded. The reason codes are:
1 The class was not found on the CLASSPATH.
2 The class did not implement the required interface ("COM.ibm.db2.app.StoredProc" or "COM.ibm.db2.app.UDF") or lacked the Java "public" access flag.
3 The default constructor failed or was unavailable.
4 Could not load driver for "jdbc:default:connection".
5 Could not establish default context.
Ensure that the compiled ".class" file is installed in the CLASSPATH, for example under "sqllib/function". Ensure it implements the required Java interfaces and is "public".
sqlcode : -4304
sqlstate : 42724
I will appreciate it if someone can guide me to determine if at all I am properly set up to invoke a javaUDF, what do I need to look for, and how I can go about setting up my environment and the UDF to execute successfully.
I fyou any question that you need answered please do not hesitate to ask as I will be monitoring this forum for the best part of this evening.