How to implement Java UDF using CLOB for DB2GENERAL parameter passing?
When you use DB2GENERAL parameter passing in the declaration of the SQL UDF, DB2 will use the legacy driver to map the data types between Java and DB2. If you need to pass CLOB as a parameter in your JAVA UDF, please follow these points. 1. You have decided to use the parameter style for a JAVA UDF as DB2GENERAL. 2. The Java class that you are writing should extend UDF from COM.ibm.db2.app.UDF 3. The return parameter should be the part of Java function arguments. 4. You should use COM.ibm.db2.app.Clob for Clob and not java.sql.Clob For example, if you want to write a java UDF that will do pattern matching on a CLOB column and returns 1 if a match was found else returns 0.