13.28 SQLException Class
The SQLException
class provides information on generated errors, their codes and associated messages.
Table 13-40 Summary of SQLException
Method | Description |
---|---|
|
|
Returns the database error code. |
|
Returns the error message |
|
Returns the error message |
|
Returns the error message |
|
Returns the error message |
|
Returns the error message string for this exception. |
|
Determines whether an application can failover and recover from an error. |
|
Sets the error context. |
|
Returns the error message associated with the |
13.28.1 SQLException()
This is the SQLException
constructor.
Syntax | Description |
---|---|
SQLException(); |
Constructs a |
SQLException( const SQLException &e); |
Constructs an |
Parameter | Description |
---|---|
e |
The |
13.28.3 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;
13.28.4 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.
Syntax
string getNLSMessage( Environment *env) const;
Parameter | Description |
---|---|
env |
The globalization enabled environment. |
13.28.5 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.
Syntax
UString getNLSUStringMessage( Environment *env) const;
Parameter | Description |
---|---|
env |
The globalization enabled environment. |
13.28.6 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.
Syntax
UString getUStringMessage() const;
13.28.7 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 getXAErrorCode( const string &dbname) const;
Parameter | Description |
---|---|
dbname |
The database name; same as the optional |
13.28.8 isRecoverable()
Determines whether an application can failover and recover from an error. Returns TRUE
if recoverable.
For example, an application may recover from ORA-03113
, but not from ORA-942
.
Syntax
bool isRecoverable();
13.28.9 setErrorCtx()
Sets the pointer to the error context.
Syntax
void setErrorCtx( void *ctx);
Parameter | Description |
---|---|
ctx |
The pointer to the error context. |