where the value= is the actual value going in and the sqltype= is the java.sql.Types value for the appropriate column. I am using the pstmt.setObject(paramIdx, value, sqlType) method where as you can see from above, i think i am slapping in the right values. The column(s) I am querying are nullable, btw.
Essentially I am trying to weed out some data from the database and need to query where "X is NULL" hence in parameter 3 I have a null value going in. The column type is correct - it's Integer, but i need the null in there. [I also tried setting the sqlType to a proper java.sql.Types.NULL but that threw a whole different error about Program Not Allowed or something]
It throws this when it comes to actually executing the query:
COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver][DB2/6000] SQL0104N An unexpected token "IS" was found following "= ? OR inboundstatus". Expected tokens may include: "IN". SQLSTATE=42601
if i cut and paste the query as it should be into my fav tool it runs no problems:
SELECT * FROM SOQADM01.TEST_JOB_STATUS WHERE inboundstatus = 9 OR outboundstatus = 9 OR inboundstatus IS null AND outboundstatus = 9