Skip Headers

Oracle® C++ Call Interface Programmer's Guide
10g Release 1 (10.1)

Part Number B10778-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Feedback

Go to previous page
Previous
Go to next page
Next
View PDF

SQLException Class

The SQLException class provides information on generated errors, their codes and associated messages.

Table 10-35 Summary of SQLException

Method Description
SQLException()
SQLException constructor.
getErrorCode()
Return the database error code.
getMessage()
Return the error message string for this exception.
getNLSMessage()
Return the error message string for this exception (Unicode support).
getNLSUStringMessage()
Return the error message UString for this exception (Unicode)support.
getUStringMessage()
Return the error message UString for this exception.
getXAErrorCode()
Return the error message string for this exception.
setErrorCtx()
Set the error context.


SQLException()

This is the SQLException constructor.

Syntax Description
SQLException();
Constructs a NULL SQLException object.
SQLException(
   const SQLException &src);
Constructs an SQLException object as a copy of another SQLException object.

Parameter Description
src
The SQLException to be copied.


getErrorCode()

Gets the database error code.


Syntax
int getErrorCode() const;


getMessage()

Returns the error message string of this SQLException if it was created with an error message string. Returns NULL if the SQLException was created with no error message.


Syntax
string getMessage() const;


getNLSMessage()

Returns the error message string of this SQLException if it was created with an error message string. Passes the globalization enabled environment. Returns a NULL string if the SQLException was created with no error message. The error message will be in the character set associated with the environment.


Syntax
UString getNLSMessage(
   Environment *env) const;

Parameter Description
env
The globalization enabled environment.


getNLSUStringMessage()

Returns the error message UString of this SQLException if it was created with an error message UString. Passes the globalization enabled environment. Returns a NULL UString if the SQLException was created with no error message. The error message will be in the character set associated with the environment.


Syntax
UString getNLSUStringMessage(
   Environment *env) const;

Parameter Description
env
The globalization enabled environment.


getUStringMessage()

Returns the error message UString of this SQLException if it was created with an error message UString. Returns a NULL UString if the SQLException was created with no error message. The error message will be in the character set associated with the environment.


Syntax
UString getUStringMessage() const;


getXAErrorCode()

Determine if the thrown exception is due to an XA or an SQL error.

Used by C++ XA applications with dynamic registration. Returns an XA error code if the exception is due to XA, or XA_OK otherwise.


Syntax
int getrXAErrorCode(
   const string &dbname);
Parameter Description
dbname
The database name; same as the optional dbname provided in the Open String (and used when connecting to the Resource Manager).


setErrorCtx()

Sets the pointer to the error context.


Syntax
void setErrorCtx(
   void *ctx);
Parameter Description
ctx
The pointer to the error context.