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