Rogue Wave banner
Previous fileTop of DocumentContentsIndexNext file

2.9 Error Messages: Contents of RWDBStatus

DB-Library distinguishes between errors originating from SQL server and errors generated within DB-Library itself. DBTools.h++ honors this distinction by assigning error code serverError to errors from SQL Server and error code vendorLib to ones from DB-Library.

2.9.1 Reporting Errors from DB-Library

RWDBStatus uses the following format to report errors from DB-Library:

Notice that errors with a severity level of 0 are given special handling when such errors occur, the RWDBStatus::errorCode is set to RWDBStatus::ok, the rest of the RWDBStatus is populated, and the application's error handler (if any) is invoked. This means that DBTools.h++ applications will ignore these errors by default, but can process them if necessary. It also means that your error handler should check vendorError2 (severity) before raising an exception.

2.9.2 Reporting Errors from SQL Server

The following format shows how RWDBStatus reports messages from SQL Server:

Notice that RWDBStatus provides special handling for messages that result from SQL PRINT statements (in which both severity and message number are 0) and for "context switch" messages (for example, "Changed database context to master"). When these messages occur, the RWDBStatus::errorCode is set to RWDBStatus::ok, the rest of the RWDBStatus is populated, and the application's error handler (if any) is invoked. Since, in such cases, errorCode is ok, DBTools.h++ applications will ignore these errors by default. However, the error information itself is still accessible if the application needs to check it. Your error handler should check vendorError2 (severity) before raising an exception.


Previous fileTop of DocumentContentsIndexNext file

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