Looping through recordsets in Java is terribly slow
843798Jan 13 2007 — edited Jan 25 2007Hi All,
I am a decent java programmer(or at least I presume to be).Recently I had to work with a application where I connect to Oracle database and fetch huge number of records(in terms of say 0.2 million).application was painfully slow.
I started working on the optimizing the PL-SQL query but to my amusement query took just 70milliseconds to fetch about 50000 records.The resultset of this fetch is looped through in Java and the fields are put into a Java bean.This took about 21 seconds.Is this a norm or exception?Does this reflect poor coding.I am amused as all that I do in the fetch is just loop through the recordset and put the fields(about 7 fields) into the bean.
Could anyone throw some light on this?Thnks in advance.
Best Regards,
Prithvi