Skip Headers
Oracle® C++ Call Interface Programmer's Guide,
11g Release 2 (11.2)

Part Number E10764-02
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
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub
LNCPP1020

SQLException Class

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

LNCPP21558Table 13-40 Summary of SQLException

Method Description

SQLException()

SQLException constructor.

getErrorCode()

Returns the database error code.

getMessage()

Returns the error message string for this exception.

getNLSMessage()

Returns the error message string for this exception (Unicode support).

getNLSUStringMessage()

Returns the error message UString for this exception (Unicode support).

getUStringMessage()

Returns the error message UString for this exception.

getXAErrorCode()

Returns the error message string for this exception.

setErrorCtx()

Sets the error context.

what()

Returns the error message associated with the SQLException.


LNCPP21559

SQLException()

This is the SQLException constructor.

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

Parameter Description
e
The SQLException to be copied.

LNCPP21560

getErrorCode()

Gets the database error code.

LNCPP21561Syntax

int getErrorCode() const;
LNCPP21562

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.

LNCPP21563Syntax

string getMessage() const;
LNCPP21564

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 is in the character set associated with the environment.

LNCPP21565Syntax

string getNLSMessage(
   Environment *env) const;
Parameter Description
env
The globalization enabled environment.

LNCPP21566

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 is in the character set associated with the environment.

LNCPP21567Syntax

UString getNLSUStringMessage(
   Environment *env) const;
Parameter Description
env
The globalization enabled environment.

LNCPP21568

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 is in the character set associated with the environment.

LNCPP21569Syntax

UString getUStringMessage() const;
LNCPP21570

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.

LNCPP21571Syntax

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

LNCPP21572

setErrorCtx()

Sets the pointer to the error context.

LNCPP21573Syntax

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

LNCPP21574

what()

Standard C++ compliant function; returns the error message associated with the SQLException.

LNCPP21575Syntax

const char *what() const throw(); 
Reader Comment

   

Comments, corrections, and suggestions are forwarded to authors every week. By submitting, you confirm you agree to the terms and conditions. Use the OTN forums for product questions. For support or consulting, file a service request through My Oracle Support.

Hide Navigation

Quick Lookup

Database Library · Master Index · Master Glossary · Book List · Data Dictionary · SQL Keywords · Initialization Parameters · Advanced Search · Error Messages

Main Categories

This Page

This Document

New and changed documents:
RSS Feed HTML RSS Feed PDF