Use the SybMessageHandler interface to customize the way SAP jConnect handles error messages generated by the server.
Universal error handling – error-handling logic can be placed in your error-message handler, instead of being repeated throughout your application.
Universal error logging – your error-message handler can contain the logic for handling all error logging.
Remapping of error-message severity, based on application requirements – your error-message handler can contain logic for recognizing specific error messages, and downgrading or upgrading their severity based on application considerations rather than the severity rating of the server. For example, during a cleanup operation that deletes old rows, you might want to downgrade the severity of a message that a row does not exist. However, you may want to upgrade the severity in other circumstances.
Return the SQL exception as is.
Return a null. As a result, SAP jConnect ignores the message.
Create a SQL warning from a SQL exception, and return it. This results in the warning being added to the warning-message chain.
If the originating message is a SQL warning, messageHandler can evaluate the SQL warning as urgent, and create and return a SQL exception once the control is returned to SAP jConnect.