When I run the below query in DB2 I get the expected results. But when I try to run the same query from java I get the error as expected token error.
Below is my query.
SELECT appTrans.application_id, appTrans.trans_ts, appTrans.trans_status FROM APPLICATIONS_TRANS_DETAILS appTrans INNER JOIN (SELECT appTrans2.application_id, max(appTrans2.trans_ts) AS Column2 FROM APPLICATIONS_TRANS_DETAILS appTrans2 GROUP BY appTrans2.application_id) AS appTrans3 ON appTrans.application_id = appTrans3.application_id AND appTrans.trans_ts = appTrans3.Column2 where appTrans.application_id in(select App.APPLICATION_ID from APPLICATIONS As App where App.SKILL_ID in(121024, 121025, 121026, 121027, 121028, 121029) and App.USER_CNUM_ID='072725744' and App.LEVEL_ID in (1, 2, 3) order by skill_id) ORDER BY appTrans.application_id;
First off, be careful which forum you post to. This is more of a JDBC issue than a Object-Relational Mapping.
Second, we really can't answer your question without having a copy of your database schema (we don't need all the table definitions though). My best advice is to cut down the size of the query eliminating items until you find out why java and non-java access returns different results. Just general debugging skills will help.