We help IT Professionals succeed at work.

Wait for the server to complete a query result before proceeding with the rest of teh code!

snajalm asked
Would there be any need to make the application wait for certain period of time until a large query is run on the server and the resultset comes back?!
Watch Question

Awarded 2011
Awarded 2011

No, you usually don't need to do anything about - JDBC application will nlormally wait itelf untltil the query returns results set
Awarded 2011
Awarded 2011
It will block until the query returns and it will be processing data as ssoon as they are arriving
I guess, that in the case of large query they will come not all rows in one moment, but
usually Java or driver takkes care of all of it).
I uesed to return very many rowas and didn't ahve any issues either with waiting or with memory (unless of courese you store everything after reading the query)
generally applications would wait for the quer to be completed in DB but there are situations the apps wanted to wait only a particular amount of time and then timeout, say the query execution takes longer time( in high load ) and the application don't want to wait that long to avoid thread contention. you can achieve it by setting timeout value to the statement obj.


Thanks experts!

Explore More ContentExplore courses, solutions, and other research materials related to this topic.