Hi,
<br><br>
My application server and database server are on different machines.
I executed a query which resulted in few thousands of rows.
Then, I would loop through the resultset and set it to my object
(code snippet as below):
<br><br>
while (resultset.next()) {
// print some log info - (1)
// create my object - (2)
// set resultset to object - (3)
}
<br><br>
I noticed that before entering the loop for the first time, there would
be a delay for about 10 seconds. And this would re-occur constantly after processing about 500 records. Meaning to process 4000 records,
the minimum time needed is 10 x (4000 / 500) = 80 seconds.
<br><br>
I tried executing the same query with a database client program. I tooks
less than 10 seconds to return all the rows to me.
<br><br>
1) Could someone please explain what is the ~10 seconds delay for with
the
JDBC query ?
2) Is there anyway to improve the performance for the query ?
(I tried setting the fetchsize but my JDBC driver don't seem
to bother)
<br><br>
Please advice.
<br><br>
Thank you.