Menu
Simba Technologies
Simba Technologies

SimbaEngine X SDK 10.1.3
Developing Drivers for Data Stores Without SQL

Posting Warning Messages

The SimbaEngine X SDK supports warning messages in a similar way as it supports error messages.

Using the IWarningListener interface

You can post warnings to an IWarningListener interface. The DataStoreInterface core classes, DSIEnvironment, DSIConnection and DSIStatement, each have an associated IWarningListener. Your custom implementation of these classes can access an IWarningListener through the parent GetWarningListener() method.

For the complete list of warnings that can be posted to an IWarningListener, see the file DataAccessComponents\Include\Support\DiagState.h in your SimbaEngine X SDK installation directory.

Similar to ErrorException, IWarningListener uses the error messages files associated with the DSIMessageSource to retrieve the warning messages corresponding to the error or warning code. For more information on this functionality, see Including Error Message Files.

Subscribing to an IWarningListener

The SDK controls most of the classes that warning listeners can be registered with. This means you don't have to explicitly register them in your custom driver code. The one exception is the ConnectionSetting object - you must register the warning listener with this class after construction. See the example in Handling Connections.

Posting Warnings to an IWarningListener

Use GetWarningListener()->PostWarning() to post a warning to the warning listener.

Example: ConnectionSetting object Posting Warnings to an IWarningListener

// In CustomerDSIIEnvironment, CustomerDSIIConnection and

// CustomerDSIIStatement, use the parent GetWarningListener()

// function to retrieve the IWarningListener

this->GetWarningListener()->PostWarning(

Diagnostics::OPT_VAL_CHANGED,

ComponentKey,

L”WarningMessageKey”);

 

Related Links

Posting Warning Messages

Including Error Message Files

Localizing Messages