Customizing error-message handling  Error-message-handler example

Chapter 2: Programming Information

Installing an error-message handler

You can install an error-message handler implementing SybMessageHandler by calling the setMessageHandler( ) method from SybDriver, SybConnection, or SybStatement. If you install an error-message handler from SybDriver, all subsequent SybConnection objects inherit it. If you install an error-message handler from a SybConnection object, it is inherited by all SybStatement objects created by that SybConnection.

This hierarchy only applies from the time the error-message handler object is installed. For example, if you create a SybConnection object, myConnection, and then call SybDriver.setMessageHandler( ) to install an error-message handler object, myConnection cannot use that object.

To return the current error-message handler object, use getMessageHandler( ).





Copyright © 2003. Sybase Inc. All rights reserved. Error-message-handler example

View this book as PDF