View Single Post

   
  #1 (permalink)  
Old 02-27-2008, 06:52 AM
Rhino
 
Posts: n/a
Default UnsatisfiedLinkError in Java UDF

I'm trying to debug a simple Java UDF written in the DB2General style within
Eclipse.

I'm getting a java.lang.UnsatisfiedLinkError when I execute the set() method
in the UDF. I know that the UnsatisfiedLinkError has something to do with a
DLL that is not visible but I'm not sure why I'm having the problem given
that both db2java.zip and db2jcc.jar are visible on my classpath and each of
them contain the COM.ibm.db2.app.UDF class with a variety of set() methods,
including the one that I am trying to execute. I've also tried removing
db2java.zip from the classpath to see if that would help prevent the error
but it didn't.

Does anyone have any idea how I can solve this problem?

This is the UDF. By the way, I'm pretty sure there are no errors in it and I
know the code is trivial; I'm just trying to debug it with Eclipse to prove
that I can. Another UDF I wrote that also grabs the leftmost characaters of
a String works fine but it is written in style "Java" and is therefore
missing the set() method.

---------------------------------------------------------------------------------------------------------------------
public void leftmost(String input, int size, String output) throws
Exception {

String trimmedInput = input.trim();
if (trimmedInput.length() < size) size = trimmedInput.length();
String leftmost = trimmedInput.substring(0, size);

set(3, leftmost);
}
---------------------------------------------------------------------------------------------------------------------

I'm using Eclipse 3.1.1 and DB2 V8.1.8.762 on Windows XP (SP2).

--
Rhino


Reply With Quote