This project has retired. For details please refer to its Attic page.
tmudr: tmudr::UDRException Class Reference

tmudr::UDRException Class Reference

This is the exception to throw when an error occurs in a UDR. More...

#include <sqludr.h>

Public Member Functions

 UDRException (int sqlState, const char *printf_format,...)
 UDRException (const char *sqlState, const char *printf_format,...)
const char * getSQLState () const
const std::string & getMessage () const
const std::string & getText () const

Detailed Description

This is the exception to throw when an error occurs in a UDR.

The SQLState value must be a value between 38000 and 38999, since the SQL standard reserves SQLState class 38 for user-written code. SQLState values 38950 to 38999 are reserved for use by Trafodion code. Trafodion will produce SQL error code -11252 when this exception is thrown.


Constructor & Destructor Documentation

UDRException::UDRException ( int  sqlState,
const char *  printf_format,
  ... 
)

Constructor with an integer value for SQLSTATE

Parameters:
sqlState ISO/ANSI SQLSTATE value to produce for this error. According to the standard, this must be a value in the range of 38000 - 38999 (note that since we use an integer, non-numeric SQLSTATE values cannot be generated.
printf_format a format string like it is used in printf, with a variable list of arguments to be substituted. Example: new UDRException(38001, "num %d, string %s", 1, "a");
UDRException::UDRException ( const char *  sqlState,
const char *  printf_format,
  ... 
)

Constructor with a string value for SQLSTATE

Parameters:
sqlState ISO/ANSI SQLSTATE value to produce for this error. According to the standard, this must be a value of the form 38xxx, with the xxx being digits or upper case letters.
printf_format a format string like it is used in printf, with a variable list of arguments to be substituted.

Member Function Documentation

const std::string & UDRException::getMessage (  )  const

Get the error message associated with this exception

Returns:
A string, representing the error message, including any substituted text with the additional arguments in the constructor. Note that this is a reference to a data member, it lives only as long as the UDRException object.
const char * UDRException::getSQLState (  )  const

Get the SQSTATE value for this exception

Returns:
A string, representing the SQLSTATE. Note that this is a pointer to a data member, the buffer lives only as long as the UDRException object.
const std::string & UDRException::getText (  )  const

Get the error message associated with this exception

Returns:
Same as getMessage().
Deprecated:
Use getMessage() instead, in Java that is the standard method.

The documentation for this class was generated from the following files:
 All Data Structures Functions Enumerations Enumerator

Generated on 31 Aug 2016 for tmudr by  doxygen 1.6.1