Groups > DB2 > DB2 UDB > Need help in creating JAVA UDF




Need help in creating JAVA UDF

Need help in creating JAVA UDF
Fri, 17 Aug 2007 08:46:23 EDT
Need help in creating JAVA UDF

Hi all,
I'm newbie on java programming.

I'm trying to develop a JAVA UDF that returns the n-1 value (the previous)
passed to it, I think that using SCRATCHPAD is a good idea.

Here is my java code for a UDF that simply returns the integer value you pass
it:

CREATE FUNCTION testIt(INTEGER) RETURNS INTEGER
EXTERNAL NAME 'ACFTestFunc!testIt'
not fenced
language java
parameter style db2general
no sql
scratchpad
no external action          

import java.sql.*;
class ACFTestFunc extends COM.ibm.db2.app.UDF
{
	public void testIt(int inValue, int result) 
	throws Exception 
	{
		set(2,inValue);
	}
}

Someone colud help me to modify this code ?

Thanks a lot
Ciao

Post Reply
about | contact