Java UDF problem 
Author Message
 Java UDF problem

I created a Java UDF.  Copied the class file to the appropriate folder
d:\sqllib\function\udf.  I registerd the function and created a trigger that
would call this function.  However, I always get this error message.

SQL4306N  Java stored procedure or user-defined function
"SQL010224205313968",
specific name "SCH.TEST1" could not call Java method "test", signature
"()I".
SQLSTATE=42724

Below are the commands I used to register the function and to create the
trigger.

CREATE FUNCTION SCH.TEST1()
RETURNS INTEGER
FENCED
LANGUAGE JAVA
PARAMETER STYLE JAVA
EXTERNAL NAME 'udf.MyBlob.test'
NO SQL

where udf is the package, MyBlob is the class and test is the method.

CREATE TRIGGER SCH.MYTEST AFTER  UPDATE  ON SCH.MASTER_DIST
REFERENCING  NEW AS newrow
FOR EACH ROW  MODE DB2SQL
VALUES (test1())

Anything wrong with this?  Setup problem maybe? Environment?

Any help would be great.

Stan



Fri, 22 Aug 2003 07:46:51 GMT
 Java UDF problem

Hi, I use one other step to import an java UDF. After all I think also you need a ':' char between the jar file name and the class name!
Below I list how I register a java udf, hope that may help!


create function download(varchar(255)) returns integer

Cheers
Marco Angeli



Fri, 22 Aug 2003 16:42:40 GMT
 Java UDF problem
What's the signature of your method "test". Is it public? Can you post it?
Seems like DB2 can load the class, it's just that it can't find a method
that matches your DDL.

Regards, Dirk


Quote:
> I created a Java UDF.  Copied the class file to the appropriate folder
> d:\sqllib\function\udf.  I registerd the function and created a trigger
that
> would call this function.  However, I always get this error message.

> SQL4306N  Java stored procedure or user-defined function
> "SQL010224205313968",
> specific name "SCH.TEST1" could not call Java method "test", signature
> "()I".
> SQLSTATE=42724

> Below are the commands I used to register the function and to create the
> trigger.

> CREATE FUNCTION SCH.TEST1()
> RETURNS INTEGER
> FENCED
> LANGUAGE JAVA
> PARAMETER STYLE JAVA
> EXTERNAL NAME 'udf.MyBlob.test'
> NO SQL

> where udf is the package, MyBlob is the class and test is the method.

> CREATE TRIGGER SCH.MYTEST AFTER  UPDATE  ON SCH.MASTER_DIST
> REFERENCING  NEW AS newrow
> FOR EACH ROW  MODE DB2SQL
> VALUES (test1())

> Anything wrong with this?  Setup problem maybe? Environment?

> Any help would be great.

> Stan



Sat, 23 Aug 2003 04:48:27 GMT
 
 [ 3 post ] 

 Relevant Pages 

1. Java UDF Problem

2. PROBLEM IN CALLING JAVA UDF's

3. Java UDF newbie questions/problem

4. UDF: Java VM can't find java.lang.System

5. UDF problem using If-Else in simple UDF

6. ---JAVA-----JAVA-----JAVA-----JAVA-----JAVA-----JAVA-----JAVA-----JAVA---

7. Java UDF

8. Calling a UDF in informix from a Java App

9. How to establish a connection in a java UDF

10. Help with JAVA UDF

11. BLOB as parameter in a JAVA-UDF

12. Refreshing java UDF


 
Powered by phpBB® Forum Software