If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > UDF unable to load Java class. What do I need to do to make this work?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-29-08, 20:25
pagwu pagwu is offline
Registered User
 
Join Date: Mar 2007
Posts: 70
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:
SQL
select nm_frst, NM_LST, DB2ADMIN.DMPHONEJAVASCALAR(NM_LST)
from FSNST201.BR_DOH_BIRTH_RECORD
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 "".

Explanation:
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.

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

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.

Thanks
Reply With Quote
  #2 (permalink)  
Old 01-30-08, 16:13
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
I didn't read your full post (sorry), but you may want to have a look at this article: http://www.ibm.com/developerworks/db...le/dm-0510law/
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
Reply With Quote
  #3 (permalink)  
Old 01-30-08, 19:13
pagwu pagwu is offline
Registered User
 
Join Date: Mar 2007
Posts: 70
Thank you again Knut...the article looks promising. Let me do some reading hopefully I will learn something to solve my problem
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On