I am having two different environments for development in my company and we connect to two different databases. The issue I am seeing is, in one environment my query runs fine returning the expected data. But in second environment, even though the query returns the data (when I ran this in Toad SQL window) , the resultSet is not null but it never enters the while loop (i.e. while (resultSet.next() loop). I tried putting debugging statemnets and i found that I get resultset exusted error. What can be the reason that in one environment I don't see any issue with my query and code and in another even though data exists , there are issues like exuated resultset error.