DCL 4.0
Loading...
Searching...
No Matches
IFXConnection.h
Go to the documentation of this file.
1#ifndef __DCL_INFORMIX_CONNECTION_H__
2#define __DCL_INFORMIX_CONNECTION_H__ 20030717
3
4__DCL_BEGIN_NAMESPACE
5
7{
9protected:
10 ByteString __connectionID;
11 ByteString __lastErrorMessage;
12
13 void reset();
14public:
15 void setErrorStatus(SQL::Error _error, long _SQLCODE,
16 const wchar_t* _filename, int _line);
17 void setErrorStatus(const ByteString& _message,
18 const wchar_t* _filename, int _line);
19
20 _CONST char* connectionID() const;
21
22public:
23 // interface implementation
24 virtual void destroy();
25 IFXConnection(const wchar_t* _serverTitle);
26 virtual ~IFXConnection();
27 virtual bool __open(const char* _connString, size_t _connlen);
28 virtual bool __close();
29 virtual bool __execute(const char* _sql, size_t _sqllen);
30 virtual bool __startTrans();
31 virtual bool __commitTrans();
32 virtual bool __rollbackTrans();
33 virtual bool __createQueryInstance(SQL::Query** _queryHandleOut);
34 virtual bool __getErrorMessage(char* _buf, size_t* _buflen);
35 virtual bool __getServerInfo(char* _buf, size_t* _buflen);
36};
37
38inline void IFXConnection::setErrorStatus(const ByteString& _message,
39 const wchar_t* _filename, int _line)
40{
41 Connection::setErrorStatus(SQL::eServerError, _filename, _line);
42 __lastErrorMessage = _message;
43}
44
46{
47 return (_CONST char*)__connectionID.data();
48}
49
50#undef __SET_ERROR
51#define __SET_ERROR(_error) \
52 setErrorStatus(_error, 0L, __THIS_FILE__, __LINE__)
53
54#define __SET_ERROR_SQLCODE(SQLCODE) \
55setErrorStatus(SQL::eServerError, SQLCODE, __THIS_FILE__, __LINE__)
56
57#define __SET_ERROR_MSG(_message) \
58 setErrorStatus(_message, __THIS_FILE__, __LINE__)
59
60__DCL_END_NAMESPACE
61
62#endif // __DCL_INFORMIX_CONNECTION_H__
#define _CONST
Definition Config.h:353
#define DECLARE_CLASSINFO(class_name)
Definition Object.h:210
virtual ~IFXConnection()
void setErrorStatus(SQL::Error _error, long _SQLCODE, const wchar_t *_filename, int _line)
_CONST char * connectionID() const
virtual bool __startTrans()
virtual bool __commitTrans()
virtual bool __rollbackTrans()
virtual bool __open(const char *_connString, size_t _connlen)
virtual bool __createQueryInstance(SQL::Query **_queryHandleOut)
virtual void destroy()
virtual bool __close()
virtual bool __execute(const char *_sql, size_t _sqllen)
virtual bool __getServerInfo(char *_buf, size_t *_buflen)
IFXConnection(const wchar_t *_serverTitle)
virtual bool __getErrorMessage(char *_buf, size_t *_buflen)
__PROTECTED const wchar_t int _line
Definition SQLCore.h:390
__PROTECTED const wchar_t * _filename
Definition SQLCore.h:390
Error
Definition SQLCore.h:19
@ eServerError
Definition SQLCore.h:21