views:

185

answers:

2

Does db2 support asynchronous SQL operations? I.e. if I execute a select stmt on a table which has 20M rows and I expect back 5M rows. When I run this query via JDBC, I want the control to be returned immediately while the db is executing the query and populating the ResultSet asynchronously in the backend thread.

I know some dbs like SQL Server support, is it supported in DB2?

~Sri

+1  A: 

This is not a DB2 question, per se. It is done in Java by using Java's threads. Create a wrapper method...

Richard T
A: 

You didn't tag the question with Java or JDBC, so I don't know if that's all you're interested in. But with ODBC it definitely works and doesn't require threads at all. Actually the SQLExecute function is asynchronous by default, and will return immediately. You have to poll it yourself to see when the return value changes to notify you that the execution is done. I'm surprised if/that Java does it differently.

Michel