while( result_set.next() )
{
...
}
I have use System.nanoTime()
and calculated the time, for each iteration the time taken is in milliseconds but the overall loop takes about 16s. I am considering a possible reason that the condition test is taking a lot of time, the next()
function.
FYI I am connecting to a remote database server and the select query that I make is completed in milliseconds again calculated using the above mentioned method. Any reasons about why it's happening and how I can bring the time to iterate the resultset down to at max a second?
EDIT:
I am dealing with about 4000 records and each record contians about 10 columns each having a size of about 10 chars
EDIT2 Thanks setFetchsize() did the magic, awesome, awesome