JagSendData  JagSetInstanceData

Chapter 5: C Routines Reference

JagSendMsg

Description

Send an error message to the calling client application from a C component.

Syntax

#include <jagpublic.h> 
JagStatus JagSendMsg(
              JagSeverity severity, 
              SQLINTEGER errnum, 
              SQLPOINTER msgtext)

Parameters

severity

Must be JAG_SEVERITY_ERROR.

errnum

An integer code for the error.

msgtext

A null-terminated string containing a description of the error.

Returns

JAG_SUCCEED for successful execution.

If an error occurs, JagSendMsg writes error descriptions to the server log file and returns JAG_FAIL.

Usage

JagSendMsg sends an error message to the client application that invoked the currently executing method. JagSendMsg provides a C facility similar to Java exceptions.

NoteNote Do not call JagSendMsg in C++ components. Instead, throw a user-defined or CORBA system exception.

JagSendMsg should be called only to describe errors that prevent successful completion of a method call. JagSendMsg causes an exception to be thrown in a Java or ActiveX client; in these clients, the exception may preempt the arrival of INOUT parameter values. To return additional status information from a successful call, use additional INOUT parameters.

JagSendMsg should be called only once per method execution, because clients may not be able to process more than one message.


How clients process messages

Clients process the received message differently depending on the type of client:

See also

JagLog

Appendix C, “Creating C Components,” in the EAServer Programmer’s Guide





Copyright © 2005. Sybase Inc. All rights reserved. JagSetInstanceData