DB Access Module for DB2 CLI User’s Guide : Chapter 2 Technical Information : Result Sets
Result Sets
In the DB Interface Module paradigm, all results are tables. Class RWDBTable encapsulates a single result set, class RWDBResult encapsulates a sequence of 0 or more tables, and class RWDBReader provides the mechanism for reading a table. Consequently, handling multiple result sets is never a problem.
In the DB Interface Module, the execute() method of each class returns an RWDBResult object. Applications that use results returned by an INSERT, for example, can do so in a portable way by checking the RWDBResult returned by RWDBInserter::execute().
Data is exchanged between DB2 CLI and the DB Interface Module through ODBC function calls. The statement associated with these calls is either explicitly closed by the Access Module or, if processing multiple results, implicitly closed through a call to SQLMoreResults(). The net effect is that any data not processed by an application is silently discarded; SourcePro DB applications do not need to consider the state of the database connection.
Simultaneous Processing of Results from Multiple Statements Using the Same Connection
The DB Access Module for DB2 CLI queries the DB2 CLI library for the maximum number of simultaneously active SQL statements (SQLHSTMT) allowed per connection (SQL_MAX_CONCURRENT_ACTIVITIES). If a connection is used for a new operation, but already has the maximum number of simultaneous operations active, the results of the oldest operation are silently discarded. DB2 CLI allows an indefinite number of active statements per connection, enabling simultaneous processing of multiple statements.