Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2007

    Unanswered: UDF unable to load Java class. What do I need to do to make this work?

    Hello all,
    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:

    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 ("" or "")

    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.

    User Response:

    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
    SQLCODE: -4304

    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

    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.


  2. #2
    Join Date
    Jan 2007
    Jena, Germany
    I didn't read your full post (sorry), but you may want to have a look at this article:
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

  3. #3
    Join Date
    Mar 2007
    Thank you again Knut...the article looks promising. Let me do some reading hopefully I will learn something to solve my problem

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts