Rogue Wave banner
Previous fileTop of DocumentContentsIndexNext file

2.10 Result Sets

In the DBTools.h++ paradigm, all results are tables. Class RWDBTable encapsulates a single table of results, 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.

Since SQL Server supports the notion of a trigger, it is possible for the INSERT, UPDATE, and DELETE operations to produce result sets, as well as the more common SELECT. In DBTools.h++, the execute() method of each class returns an RWDBResult object. Applications that are concerned with results being 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 SQL Server and DBTools.h++ via the DB-Library calls dbsqlexec(), dbresults(), and dbnextrow(). Before calling dbsqlexec(), DBTools.h++ calls dbcancel(); before calling dbresults(), it calls dbcanquery(). The net effect is that any data not processed by an application is silently discarded; DBTools.h++ applications do not need to be concerned with the state of the database connection.


Previous fileTop of DocumentContentsIndexNext file

©Copyright 1999, Rogue Wave Software, Inc.
Contact Rogue Wave about documentation or support issues.