String sql = "SELECT ITEMID FROM " + "(SELECT ITEMID, CREATETS, LASTCHANGEDTS FROM ICMADMIN.LLC_MISC1001 " + "UNION ALL " + "SELECT ITEMID, CREATETS, LASTCHANGEDTS FROM ICMADMIN.LLC001) AS TBL1 " + "WHERE DATE(CREATETS) <= '2012-02-28' AND DATE(LASTCHANGEDTS) <= '2012-02-28'"; PreparedStatement pstate = connection.prepareStatement(sql); Results resultset1 = pstate.executeQuery();
When I execute this code againt a 8.2 UDB database there are no exceptions but the query does not return any rows. I tried both the type 2 and type 4 drivers. Each time ResutlSet.next() fails.
When I execute this query from the DB2 Control Center it returns the rows as expected.