When the query returns less than 10000 records, everything works fine and no problem at all.
When the query returns more than 10000(exactly 13,000), after certain no of records the resultSet.next() not moving to next record eventhough there are so many records to be fetched. It doesn't throw any exception either. It's just hanging there like waiting for something to complete. The interesting part is, this failure not happening at the particular record. I ran the test three times for the same input. It failed at 11097th, 11095th and 10218th records.