DCL 3.7.4
Loading...
Searching...
No Matches
IBConnection.h
Go to the documentation of this file.
1#ifndef __DCL_IB_CONNECTION_H__
2#define __DCL_IB_CONNECTION_H__ 20020321
3
4__DCL_BEGIN_NAMESPACE
5
6#undef NULL_HANDLE
7#ifdef FIREBIRD_IBASE_H
8 #define NULL_HANDLE 0U
9#else
10 #define NULL_HANDLE (void*)0
11#endif
12
13#define ISC_STATUS_VECTOR_LENGTH 20
14#define STATUS_FAILED(statusVector) (statusVector[0] == 1 && statusVector[2])
15
17{
19protected:
20 short __dialect;
21 isc_db_handle __dbHandle;
22 isc_tr_handle __trHandle;
23 ISC_STATUS __status[ISC_STATUS_VECTOR_LENGTH];
24 ByteString __lastErrorMessage;
25
26public:
27 void setErrorHandle(
28 SQL::Error _error,
29 const wchar_t* _filename, int _line
30 );
31
32 void setErrorMessage(
33 const ByteString& _message,
34 const wchar_t* _filename, int _line
35 );
36
37 isc_db_handle* dbHandlePtr() { return &__dbHandle; }
38 isc_tr_handle* trHandlePtr() { return &__trHandle; }
39 short dialect() const { return __dialect; }
40 ISC_STATUS* statusVector() { return __status; }
41
42 // interface implementation
43public:
44 IBConnection(const wchar_t* _serverTitle);
45//protected:
46 virtual void destroy();
47 virtual ~IBConnection();
48 virtual bool __open(const char* _conns, size_t _connlen);
49 virtual bool __close();
50 virtual bool __execute(const char* _sql, size_t _sqllen);
51 virtual bool __startTrans();
52 virtual bool __commitTrans();
53 virtual bool __rollbackTrans();
54 virtual bool __createQueryInstance(SQL::Query** _queryHandleOut);
55 virtual bool __getErrorMessage(char* _buf, size_t* _buflen);
56 virtual bool __getServerInfo(char* _buf, size_t* _buflen);
57};
58
60 SQL::Error _error,
61 const wchar_t* _filename, int _line
62 )
63{
64 Connection::setErrorStatus(_error, _filename, _line);
65 __lastErrorMessage.clear();
66}
67
69 const ByteString& _message,
70 const wchar_t* _filename, int _line
71 )
72{
73 Connection::setErrorStatus(SQL::eServerError, _filename, _line);
74 __lastErrorMessage = _message;
75}
76
77__DCL_END_NAMESPACE
78
79#endif // __DCL_IB_CONNECTION_H__
#define ISC_STATUS_VECTOR_LENGTH
#define DECLARE_CLASSINFO(class_name)
Definition Object.h:227
short dialect() const
virtual bool __open(const char *_conns, size_t _connlen)
virtual bool __createQueryInstance(SQL::Query **_queryHandleOut)
void setErrorMessage(const ByteString &_message, const wchar_t *_filename, int _line)
virtual ~IBConnection()
void setErrorHandle(SQL::Error _error, const wchar_t *_filename, int _line)
virtual bool __execute(const char *_sql, size_t _sqllen)
isc_tr_handle * trHandlePtr()
virtual void destroy()
virtual bool __commitTrans()
virtual bool __getServerInfo(char *_buf, size_t *_buflen)
virtual bool __startTrans()
virtual bool __close()
ISC_STATUS * statusVector()
virtual bool __rollbackTrans()
virtual bool __getErrorMessage(char *_buf, size_t *_buflen)
isc_db_handle * dbHandlePtr()
IBConnection(const wchar_t *_serverTitle)
_PROTECTED const wchar_t * _filename
Definition SQLCore.h:439
_PROTECTED const wchar_t int _line
Definition SQLCore.h:441
Error
Definition SQLCore.h:19
@ eServerError
Definition SQLCore.h:21