View Single Post

   
  #2 (permalink)  
Old 02-27-2008, 06:54 AM
Knut Stolze
 
Posts: n/a
Default Re: UnsatisfiedLinkError in Java UDF

Rhino wrote:

> 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);
> }
>

---------------------------------------------------------------------------------------------------------------------

How did you register the function in your database, i.e. what's the exact
CREATE FUNCTION statement?

--
Knut Stolze
DB2 Information Integration Development
IBM Germany
Reply With Quote