TTStatus Reference
The TTStatus
class is used by other classes in the TTClasses library to catch error and warning exceptions. You can think of TTStatus
as a value-added C++ wrapper around the SQLError
ODBC function.
Subclasses
TTStatus
has these subclasses:
Subclass | Description |
---|---|
|
|
|
|
See TTCStatus Usage for additional information about TTError
and TTWarning
.
Public Members
Member | Description |
---|---|
|
Return code from the failing ODBC call: ( |
|
TimesTen native error number (if any) for the failing ODBC call |
|
ODBC error state for the failing ODBC call |
|
ASCII printable error message for the failing ODBC call |
Public Methods
This section summarizes then describes the TTStatus
public methods.
Public Methods Summary
Method | Description |
---|---|
Indicates whether the database connection is invalid. |
|
Outputs the error message. |
|
Throws an error from the |
isConnectionInvalid()
bool isConnectionInvalid() const
Returns TRUE
if the database connection is invalid, or FALSE
if it is valid. Specifically, "invalid" refers to situations when a TimesTen error 846 or 994 is encountered. See Errors 0 - 999 in Oracle TimesTen In-Memory Database Error Messages
and SNMP Traps.
operator<<
The operator (<<
) writes the error message to an output stream. Following is an example.
try {
// ...
// something has gone wrong
throw stat;
}
catch (TTStatus st) {
cerr << "Caught exception: " << st << endl;
}
throwError()
void throwError()
This is an alternative, but not typical, way to throw an exception. (The more typical usage is shown in the preceding operator<<
section.)
try {
// ...
if (/* something has gone wrong */)
stat.throwError();
}
catch (TTStatus st) {
cerr << "Caught exception: " << st << endl;
}