DB Link
API Reference Guide
Product Documentation:

Visualization DB Link
Documentation Home
List of all members | Public Member Functions
IldIldBase Class Referenceabstract

This is the base class for the IldDbms and IldRequest classes. More...

#include <ildblink/ildbase.h>

Inheritance diagram for IldIldBase:
IldBaseModel IldDbms IldRequest IldDbmsModel IldRequestModel IldDbmsModel IldRequestModel

Public Member Functions

virtual ~IldIldBase ()
 Destructor for the base class of DB Link session and cursor classes. More...
 
void clearDiagnostics ()
 Set diagnostic flags to false. More...
 
virtual const IldDiagnosticgetError () const =0
 Get the error container. More...
 
virtual IlInt getErrorCode () const =0
 Get the error code. More...
 
virtual const char * getErrorConnection () const =0
 Get the conneciton string. More...
 
virtual const char * getErrorMessage () const =0
 Get the error message text. More...
 
virtual const char * getErrorName () const =0
 Get the error object name. More...
 
virtual IldErrorOrigin getErrorOrigin () const =0
 Get the error origin. More...
 
virtual IldErrorReportergetErrorReporter () const =0
 Get the error reporter. More...
 
virtual const char * getErrorSqlstate () const =0
 Get the SQL state. More...
 
virtual const IldDiagnosticgetInformation () const =0
 Get the information container. More...
 
virtual IlInt getInformationCode () const =0
 Get the information code. More...
 
virtual const char * getInformationMessage () const =0
 Get the information message. More...
 
virtual IlBoolean isErrorRaised () const =0
 Tell if an error was raised. More...
 
virtual IlBoolean isInformationRaised () const =0
 Tell if a warning was raised. More...
 
virtual int operator! () const =0
 Tell if an error was raised. More...
 
virtual void setError (IldDiagnostic *diag)=0
 Set the diagnostic container provided as the error container. More...
 
virtual void setInformation (IldDiagnostic *diag)=0
 Set the diagnostic container provided as the warning container. More...
 
virtual void setNumericUse (IlBoolean flag)=0
 Turn the numeric-as-objects feature ON or OFF. More...
 
virtual void setStringDateUse (IlBoolean flag=IlTrue)=0
 Turn the date-as-string feature ON or OFF. More...
 
virtual void setStringNumericUse (IlBoolean flag=IlTrue)=0
 Turn the number-as-string feature ON or OFF. More...
 
virtual IlBoolean useNumeric () const =0
 Tell if numeric data is handled as objects. More...
 
virtual IlBoolean useStringDate () const =0
 Tell if date values will be sent and retrieved as strings. More...
 
virtual IlBoolean useStringNumeric () const =0
 Tell if numeric are handled as strings. More...
 

Detailed Description

This is the base class for the IldDbms and IldRequest classes.

Library: dbkernel

Its purpose is to serve as the common base object, which is the only one known by the error handling mechanism.

See also
IldDbms, IldErrorOrigin, IldErrorReporter, IldRequest, IlNumeric
"Date As String", "Numeric As String", and "Date As Object" in the Rogue Wave DB Link User's Manual.

Constructor & Destructor Documentation

◆ ~IldIldBase()

virtual IldIldBase::~IldIldBase ( )
virtual

Destructor for the base class of DB Link session and cursor classes.

Warning
This destructor will delete any diagnostic (error or warning) or error reporter object. Whether such object was allocated by DB Link or by the application is not taken into account.

Member Function Documentation

◆ clearDiagnostics()

void IldIldBase::clearDiagnostics ( )

Set diagnostic flags to false.

Only to be used once the error or information diagnostic has been processed.

◆ getError()

virtual const IldDiagnostic* IldIldBase::getError ( ) const
pure virtual

Get the error container.

Returns
The diagnostic container that was filled when an error was raised.
Warning
If the function isErrorRaised returns IlFalse, this container can either be the null pointer or be valid but its slot values are not meaningful.

Implemented in IldBaseModel.

◆ getErrorCode()

virtual IlInt IldIldBase::getErrorCode ( ) const
pure virtual

Get the error code.

Returns
The error code (either from DB Link or from the RDBMS) when an error has been raised in the current object.

This member function must not be called when no error is raised.

Implemented in IldBaseModel.

◆ getErrorConnection()

virtual const char* IldIldBase::getErrorConnection ( ) const
pure virtual

Get the conneciton string.

Returns
The connection string that caused the error.

This value is filled by DB Link when it detects an error in the connection arguments. This may be the DBMS name if it is unknown or if the corresponding library is not linked, or it may be the connection string if it is not properly formatted.

Implemented in IldBaseModel.

◆ getErrorMessage()

virtual const char* IldIldBase::getErrorMessage ( ) const
pure virtual

Get the error message text.

Returns
The error message (either from DB Link or from the RDBMS) when an error has been raised in the current object.

This member function must not be called unless an error has been raised.

Implemented in IldBaseModel.

◆ getErrorName()

virtual const char* IldIldBase::getErrorName ( ) const
pure virtual

Get the error object name.

Returns
The name of the object for which the error is raised.

For instance, if the error is "Unknown relation", the function returns the name of the relation.

Implemented in IldBaseModel.

◆ getErrorOrigin()

virtual IldErrorOrigin IldIldBase::getErrorOrigin ( ) const
pure virtual

Get the error origin.

Returns
The code of the layer that originated the error.

With most RDBMSs, it differentiates origins only between the server and the DB Link API.

Implemented in IldBaseModel.

◆ getErrorReporter()

virtual IldErrorReporter* IldIldBase::getErrorReporter ( ) const
pure virtual

Get the error reporter.

Returns
The current user error reporter.

If none was set by the application, it returns null.

Implemented in IldRequest, IldDbms, IldBaseModel, IldRequestModel, and IldDbmsModel.

◆ getErrorSqlstate()

virtual const char* IldIldBase::getErrorSqlstate ( ) const
pure virtual

Get the SQL state.

Returns
the SQL state corresponding to the error, whenever possible.

This is always a five-character string. It may be composed of null characters only if no SQL state description was made available by the RDBMS server that raised the error.

When an error is raised by the DB Link API, the class part of the message (the first two characters) is set to IL.

DB Link-Specific SQLSTATE Values
ILD_SQS_FATAL
ILD_SQS_TYPE
ILD_SQS_REQ
ILD_SQS_UNKRE
ILD_SQS_BDBS
ILD_SQS_BCOLN
ILD_SQS_BCNT
ILD_SQS_PRIV
ILD_SQS_EOBJ
ILD_SQS_BFIL
ILD_SQS_NREP
ILD_SQS_INVS
ILD_SQS_NOPR
ILD_SQS_NOSCR

Since some predefined errors are identified by DB Link, a few other SQLSTATE values may have been set by it:

Codes SQLSTATE value
ILD_SQS_ACON "08002"
ILD_SQS_NCON "08003"
ILD_SQS_TMSM "22005"
ILD_SQS_RNGE "21000"
ILD_SQS_NROW "02000"
ILD_SQS_NIMP "0A000"
ILD_SQS_BIND "07009"
ILD_SQS_NINT "22005"
ILD_SQS_DEIP "22023"

Implemented in IldBaseModel.

◆ getInformation()

virtual const IldDiagnostic* IldIldBase::getInformation ( ) const
pure virtual

Get the information container.

Returns
The diagnostic container that was filled when a warning was raised.
Warning
If the function isInformationRaised returns IlFalse, this container can either be the null pointer or be valid but its slot values are not meaningful.

Implemented in IldBaseModel.

◆ getInformationCode()

virtual IlInt IldIldBase::getInformationCode ( ) const
pure virtual

Get the information code.

Returns
The code number of the warning or other information that has been raised in the current object.

This member function must not be called when no information is raised.

Implemented in IldBaseModel.

◆ getInformationMessage()

virtual const char* IldIldBase::getInformationMessage ( ) const
pure virtual

Get the information message.

Returns
The text message of the warning or other information that has been raised in the current object.

This member function must not be called unless a warning has been raised.

Implemented in IldBaseModel.

◆ isErrorRaised()

virtual IlBoolean IldIldBase::isErrorRaised ( ) const
pure virtual

Tell if an error was raised.

Returns
IlTrue if an error has been raised in the current object. Otherwise, it returns IlFalse.

This function must always be called prior to accessing the diagnostic object or any of its slots.

Implemented in IldBaseModel.

◆ isInformationRaised()

virtual IlBoolean IldIldBase::isInformationRaised ( ) const
pure virtual

Tell if a warning was raised.

Returns
IlTrue if a warning or other information message has been raised in the current object. Otherwise, it returns IlFalse.

This function must always be called prior to accessing the diagnostic object or any of its slots.

Implemented in IldBaseModel.

◆ operator!()

virtual int IldIldBase::operator! ( ) const
pure virtual

Tell if an error was raised.

Returns
1 if an error has been raised in the current object. Otherwise, this operator returns 0.

It is intended to be used in conjunction with all functions from the classes IldDbms and IldRequest that return the invoker by reference.

Implemented in IldBaseModel.

◆ setError()

virtual void IldIldBase::setError ( IldDiagnostic diag)
pure virtual

Set the diagnostic container provided as the error container.

Parameters
diagThe diagnostic container to use.
Warning
If any error container exists, it will be destroyed without taking care of who allocated it.

Implemented in IldBaseModel.

◆ setInformation()

virtual void IldIldBase::setInformation ( IldDiagnostic diag)
pure virtual

Set the diagnostic container provided as the warning container.

Parameters
diagThe diagnostic container to use.
Warning
If any warning container exists, it will be destroyed without taking care of who allocated it.

Implemented in IldBaseModel.

◆ setNumericUse()

virtual void IldIldBase::setNumericUse ( IlBoolean  flag)
pure virtual

Turn the numeric-as-objects feature ON or OFF.

Parameters
flagThe value to set.

In the default configuration, the flag parameter is set to IlFalse, which means that numeric data is handled as the double type. If the value is IlTrue, numeric data is handled as objects.

Implemented in IldBaseModel.

◆ setStringDateUse()

virtual void IldIldBase::setStringDateUse ( IlBoolean  flag = IlTrue)
pure virtual

Turn the date-as-string feature ON or OFF.

Parameters
flagThe value to set.

By default, dates are handled as strings. If the argument flag is set to IlFalse, dates are not handled as strings, but rather as IldDateTime objects. See the class IldDateTime and the member function IldRequest::getColDateTimeValue().

Implemented in IldBaseModel.

◆ setStringNumericUse()

virtual void IldIldBase::setStringNumericUse ( IlBoolean  flag = IlTrue)
pure virtual

Turn the number-as-string feature ON or OFF.

Parameters
flagThe value to set.

In the default configuration, the value of the flag parameter is IlFalse, which means that numeric data is handled as the double type. If the value of flag is IlTrue, numeric data is handled as strings.

Implemented in IldBaseModel.

◆ useNumeric()

virtual IlBoolean IldIldBase::useNumeric ( ) const
pure virtual

Tell if numeric data is handled as objects.

Returns
IlFalse if numeric data is to be handled as IlNumeric objects, or IlTrue if it is to be handled as the double type.

For more information about how to manage numeric data, see the section "Numeric As Objects" in the Rogue Wave DB Link User's Manual.

Implemented in IldBaseModel.

◆ useStringDate()

virtual IlBoolean IldIldBase::useStringDate ( ) const
pure virtual

Tell if date values will be sent and retrieved as strings.

Returns
IlTrue if dates will be handled as strings, or IlFalse if they will be handled as IldDateTime objects.

For more information on how to manage dates, times, and intervals, see the section "Date As String" in the Rogue Wave DB Link User's Manual.

Implemented in IldBaseModel.

◆ useStringNumeric()

virtual IlBoolean IldIldBase::useStringNumeric ( ) const
pure virtual

Tell if numeric are handled as strings.

Returns
IlTrue if numeric data is to be handled as strings, or IlFalse if it is to be handled as double.

For more information about how to manage numeric data, see the section "Numeric As String" in the Rogue Wave DB Link User's Manual.

Implemented in IldBaseModel.