I got an oracle sql query which runs fine on oracle sql developer but when I run it from Java prepared statement sql exception thrown as "ORA-00942: table or view does not exist " and the user got all the privileges for mentioned 3 schemas. is there any problem with the Query ? currently I can't seems to find the problem and still debugging sql string is also can be executed in SQL developer .
SQL query
SELECT CLI_CLIENT.NAME ,CLI_CLIENT.CLIENT_ID,
AA.SEARCHES,
(SELECT COUNT(*) FROM RES_BOOKING,CLI_WEB_USER WHERE RES_BOOKING.BOOKED_USER=CLI_WEB_USER.ADM_USER_ID
AND TRUNC(RES_BOOKING.BOOKING_DATE) BETWEEN '01-MAR-16' AND '24-MAR-16' AND CLI_WEB_USER.CLIENT_ID=CLI_CLIENT.CLIENT_ID)AS BOOKINGS
FROM CLI_CLIENT,
(SELECT CWU.CLIENT_ID,
COUNT(ST.OPERATION) AS SEARCHES
FROM STAT.ST_TRANSACTION ST , CLI_WEB_USER CWU , CACHE.CACC_CRITERIA CC , CACHE.CACC_CRITERIA_STATS CS
WHERE ST.USER_NAME=CWU.USERNAME
AND ST.OPERATION LIKE 'OTA_HotelAvailRQ%'
AND TRUNC(ST.TRS_TIMESTAMP) BETWEEN '01-MAR-16' AND '24-MAR-16'
AND CWU.CLIENT_ID IN (10975,10040)
AND CC.CRITERIA_ID=CS.CRITERIA_ID
AND CS.SESSION_ID=ST.SESSION_ID
AND CS.DISTRIBUTION_CHANNEL='W'
GROUP BY CLIENT_ID, CWU.CLIENT_ID
)AA
WHERE CLI_CLIENT.CLIENT_ID=AA.CLIENT_ID;
Java Exception
java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist