Looping through recordsets in Java is terribly slow

Hi 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

[793 byte] By [prithvibhata] at [2007-11-26 15:03:50]
# 1

> 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?

Who knows. How big are the records? Is the database server in Australia? There are a number of reasons why it could be slow.

> Does

> this reflect poor coding.

Who know. It certainly could.

> 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?

No, not without a thorough understanding of your network, code, etc.

CarrieHunta at 2007-7-8 8:53:28 > top of Java-index,Core,Monitoring & Management...