sucheta shanbhag wrote:I feel the object creation is taking a long time,any suggestion on how to optimise this while loop.
Object creation time is solely depends upon what the object constructor do. If you have doubt about the Test object creation, then find out the time taken by the constructor call.
Otherwise, Paul is correct, pointing the the time taken by database resultset.
And I think, you shouldn't worry about such micro optimization..
The original post describes a process which starts with having the result set. And if we already have a result set doesn't that imply that any issues with network connectivity to the database are in the past? Is the problem properly stated here?
stanislav bashkirtsev wrote:Your ResultSet is connected to DB. If you want to avoid this, you can use cached version of result set.
If the issue is the connection this will not speed the process up, the data still needs to be pulled from the database.
Ok that much is clear now, thanks. Still, if you wanted to isolate database connectivity issues from the rest of the process, as one possible way to identify the bottleneck, then it would seem the cached result set would be the way to go. agreed?