0 Replies Latest reply on Oct 8, 2004 3:26 PM by David Small

    CMP Finder problem on DB2 - Program type out of range

    David Small Newbie

      Using EJB 1.1, CMP, and JAWS on jboss 3.2.1. I have a complex finder SQL as indicated in the trace below. Under some conditions a finder parameter could be null. When this happens, jBoss calls setNull(param, java.sql.NULL) instead of a more specific sql type like java.sql.VARCHAR. Unfortunately, DB2 can't handle it. Is there any way force the type to be passed in.

      Thanks

      2004-10-08 15:18:14,396 DEBUG [org.jboss.ejb.plugins.jaws.jdbc.JDBCCommand] PreloadFinder findBySimpleSearch command executing: SELECT PDD.AMC_OFFICE.OFC_I,PDD.AMC_OFFICE.LGCL_DEL_F,PDD.AMC_OFFICE.ZIP_C,PDD.AMC_OFFICE.OFC_TELE_I,PDD.AMC_OFFICE.REGN_OFC_F,PDD.AMC_OFFICE.OFC_N,PDD.AMC_OFFICE.ADDR_LINE2_T,PDD.AMC_OFFICE.FBRC_SPK_F,PDD.AMC_OFFICE.REGN_I,PDD.AMC_OFFICE.CITY_N,PDD.AMC_OFFICE.ADDR_LINE1_T,PDD.AMC_OFFICE.QA_F,PDD.AMC_OFFICE.ST_PROV_T,PDD.AMC_OFFICE.FBRIC_EMAIL_ADDR_I,PDD.AMC_OFFICE.CTRY_C,PDD.AMC_OFFICE.OFC_FAX_TELE_I,PDD.AMC_OFFICE.MR_F FROM PDD.AMC_OFFICE where ((CAST(? AS VARCHAR(255)) IS NULL) OR (UPPER(ofc_n) LIKE ?)) AND ((CAST(? AS VARCHAR(255)) IS NULL) OR (ctry_c = ?)) ORDER BY ofc_n
      2004-10-08 15:18:14,406 DEBUG [org.jboss.ejb.plugins.jaws.jdbc.JDBCCommand] Set parameter: idx=1, jdbcType=NULL, value=NULL
      2004-10-08 15:18:14,406 ERROR [org.jboss.ejb.plugins.jaws.jdbc.JDBCCommand] Exception caught executing SQL
      COM.ibm.db2.jdbc.DB2Exception: [IBM][JDBC Driver] CLI0613E Program type out of range. SQLSTATE=S1003