DCL 3.7.4
Loading...
Searching...
No Matches
ODBCConnection.h
Go to the documentation of this file.
1#ifndef __DCL_ODBC_CONNECTION_H__
2#define __DCL_ODBC_CONNECTION_H__ 20251126
3
4__DCL_BEGIN_NAMESPACE
5
6class ODBCQuery;
7
9{
11protected:
12 SQLHENV __henv;
13 SQLHDBC __hdbc;
14 ByteString __lastErrorMessage;
15
16 bool __IS_MS_SS;
17
18public:
19 SQLHDBC connHandle() const;
20
21 bool IS_MS_SS() const;
22
23 void setErrorHandle(
24 SQLRETURN _rc, SQLSMALLINT _htype, SQLHANDLE _handle,
25 const wchar_t* _filename, int _line
26 );
27
28 void setErrorMessage(
29 const ByteString& _message,
30 const wchar_t* _filename, int _line
31 );
32
33public:
34 // interface implementation
35 ODBCConnection(const wchar_t* _serverTitle);
36
37 virtual void destroy();
38 virtual ~ODBCConnection();
39 virtual bool __open(const char* _cons, size_t _conslen);
40 virtual bool __close();
41 virtual bool __execute(const char* _sql, size_t _sqllen);
42 virtual bool __startTrans();
43 virtual bool __commitTrans();
44 virtual bool __rollbackTrans();
45 virtual bool __createQueryInstance(SQL::Query** _queryHandleOut);
46 virtual bool __getErrorMessage(char* _buf, size_t* _buflen);
47 virtual bool __getServerInfo(char* _buf, size_t* _buflen);
48};
49
50inline SQLHDBC ODBCConnection::connHandle() const
51{
52 return __hdbc;
53}
54
55inline bool ODBCConnection::IS_MS_SS() const
56{
57 return __IS_MS_SS;
58}
59
61 const ByteString& _message,
62 const wchar_t* _filename,
63 int _line
64 )
65{
66 Connection::setErrorStatus(SQL::eServerError, _filename, _line);
67 __lastErrorMessage = _message;
68}
69
70__DCL_END_NAMESPACE
71
72#endif // __DCL_ODBC_CONNECTION_H__
#define DECLARE_CLASSINFO(class_name)
Definition Object.h:227
virtual bool __getErrorMessage(char *_buf, size_t *_buflen)
void setErrorMessage(const ByteString &_message, const wchar_t *_filename, int _line)
ODBCConnection(const wchar_t *_serverTitle)
SQLHDBC connHandle() const
virtual bool __open(const char *_cons, size_t _conslen)
virtual bool __execute(const char *_sql, size_t _sqllen)
void setErrorHandle(SQLRETURN _rc, SQLSMALLINT _htype, SQLHANDLE _handle, const wchar_t *_filename, int _line)
bool IS_MS_SS() const
virtual bool __commitTrans()
virtual bool __close()
virtual bool __createQueryInstance(SQL::Query **_queryHandleOut)
virtual bool __startTrans()
virtual void destroy()
virtual bool __getServerInfo(char *_buf, size_t *_buflen)
virtual ~ODBCConnection()
virtual bool __rollbackTrans()
_PROTECTED const wchar_t * _filename
Definition SQLCore.h:439
_PROTECTED const wchar_t int _line
Definition SQLCore.h:441
@ eServerError
Definition SQLCore.h:21