DCL 4.0
Loading...
Searching...
No Matches
SQLException Class Reference

#include <SQL.h>

Inheritance diagram for SQLException:
Exception Object

Public Member Functions

 SQLException (SQLConnection *_conn)
 SQLException (SQLConnection *_conn, const String &_message)
 SQLException (SQLQuery *_query)
 SQLException (SQLQuery *_query, const String &_message)
 SQLException (SQLField *_field)
 SQLException (SQLField *_field, const wchar_t *_cast, AsErrorCode errorCode)
 SQLException (SQLField *_field, const wchar_t *_cast, Exception *_cause)
 SQLException (SQLParam *_param)
virtual String toString () const
Public Member Functions inherited from Exception
 Exception (Exception *_cause=NULL)
const Exceptioncause () const
String toStringAll () const
virtual void destroy ()
Public Member Functions inherited from Object
String className () const
bool isInstanceOf (const std::type_info &typeinfo) const
virtual const std::type_info & typeInfo () const

Protected Member Functions

String getServerMessage (SQL::Connection *_connHandle)
Protected Member Functions inherited from Exception
virtual ~Exception ()
Protected Member Functions inherited from Object
virtual ~Object ()
 Object ()

Additional Inherited Members

Protected Attributes inherited from Exception
Exception__pCause

Detailed Description

Definition at line 381 of file SQL.h.

Constructor & Destructor Documentation

◆ SQLException() [1/8]

SQLException::SQLException ( SQLConnection * _conn)

Definition at line 84 of file SQLException.cpp.

86{
87 __DCL_ASSERT(_conn && _conn->handle());
88
89 __message = getServerMessage(_conn->handle());
90}
#define NULL
Definition Config.h:340
#define __DCL_ASSERT(expr)
Definition Object.h:371
Exception(Exception *_cause=NULL)
SQL::Connection * handle() const
Definition SQL.inl:160
String getServerMessage(SQL::Connection *_connHandle)

◆ SQLException() [2/8]

SQLException::SQLException ( SQLConnection * _conn,
const String & _message )

Definition at line 92 of file SQLException.cpp.

94{
95 __DCL_ASSERT(_conn && _conn->handle());
96 __message = getServerMessage(_conn->handle()) + __T(": ");
97 __message = __message + _message;
98}
#define __T(str)
Definition Object.h:44

◆ SQLException() [3/8]

SQLException::SQLException ( SQLQuery * _query)

Definition at line 100 of file SQLException.cpp.

101 : Exception(NULL)
102{
103 __DCL_ASSERT(_query && _query->handle()->connection());
104 __message = getServerMessage(_query->connection()->handle());
105}
SQLConnection * connection() const
Definition SQL.inl:154
SQL::Query * handle() const
Definition SQL.inl:149

◆ SQLException() [4/8]

SQLException::SQLException ( SQLQuery * _query,
const String & _message )

Definition at line 107 of file SQLException.cpp.

108 : Exception(NULL)
109{
110 __DCL_ASSERT(_query && _query->handle()->connection());
111 __message = getServerMessage(_query->connection()->handle()) + __T(": ");
112 __message = __message + _message;
113}

◆ SQLException() [5/8]

SQLException::SQLException ( SQLField * _field)

Definition at line 115 of file SQLException.cpp.

116 : Exception(NULL)
117{
118 __DCL_ASSERT(_field && _field->handle()->connection());
119 StringBuilder sb = getServerMessage(_field->handle()->connection()) + __T(": ");
120 sb += _field->name();
121 sb += __T("(");
122 sb += _field->dataTypeName();
123 sb += __T(",");
124 sb += _field->handle()->serverDataTypeName();
125 sb += __T(")");
126 __message = sb.toString();
127}

◆ SQLException() [6/8]

SQLException::SQLException ( SQLField * _field,
const wchar_t * _cast,
AsErrorCode errorCode )

Definition at line 145 of file SQLException.cpp.

150 : Exception(NULL)
151{
152 StringBuilder sb = __T("SQLData access type error: ");
153 sb += _field->name();
154 sb += __T("(");
155 sb += _field->dataTypeName();
156 sb += __T("), access: ");
157 sb += _cast;
158 switch(_errorCode)
159 {
160 case eInvalidCast :
161 sb += __T(": Data convert impossible");
162 break;
163 case eOutOfRange :
164 sb += __T(": Numeric convert out of range");
165 break;
166 default :
167 __DCL_ASSERT(false);
168 }
169 __message = sb.toString();
170}

◆ SQLException() [7/8]

SQLException::SQLException ( SQLField * _field,
const wchar_t * _cast,
Exception * _cause )

Definition at line 129 of file SQLException.cpp.

134 : Exception(_cause)
135{
136 StringBuilder sb = __T("SQLData access type error: ");
137 sb += _field->name();
138 sb += __T("(");
139 sb += _field->dataTypeName();
140 sb += __T("), access: ");
141 sb += _cast;
142 __message = sb.toString();
143}

◆ SQLException() [8/8]

SQLException::SQLException ( SQLParam * _param)

Definition at line 172 of file SQLException.cpp.

173 : Exception(NULL)
174{
175 __DCL_ASSERT(_param && _param->handle()->connection());
176 __message = getServerMessage(_param->handle()->connection()) + __T(": ");
177
178 __message = __message + _param->name();
179}

Member Function Documentation

◆ getServerMessage()

String SQLException::getServerMessage ( SQL::Connection * _connHandle)
protected

◆ toString()

String SQLException::toString ( ) const
virtual

Reimplemented from Exception.

Definition at line 181 of file SQLException.cpp.

182{
183 return __message;
184}

The documentation for this class was generated from the following files: