DCL 3.7.4
Loading...
Searching...
No Matches
SQLDriver.h
Go to the documentation of this file.
1
2#ifndef __DCL_SQLDRIVER_H__
3#define __DCL_SQLDRIVER_H__ 20050206
4
5#ifndef __DCL_DLL_H__
6#include <dcl/Dll.h>
7#endif
8#ifndef __DCL_INIFILE_H__
9#include <dcl/IniFile.h>
10#endif
11
12#ifndef __DCL_SQLCORE_H__
13#include <dcl/SQLCore.h>
14#endif
15
16__DCL_BEGIN_NAMESPACE
17
18// Database Driver managements
19
20class SQLDriver;
21
23{
25public:
26 enum ErrorCode
27 {
28 eInvalidDriverModule, // DCLDynamicEntryPoint가 유효하지 않다.
29 eInvalidVersion, // 유효하지 않은 DCL_SQL_VERSION 이다.
30 eInitializeFail, // 모듈초기화 callback 실패
31 eCleanupFail // cleanup callback fail
32 };
33
34 String __name;
35 ErrorCode __errorCode;
36 String __driverSummary;
37public:
38 SQLDriverException(const String& _name, Exception* _cause);
39 SQLDriverException(const String& _name, ErrorCode _errorCode);
40
42 const String& _name, ErrorCode _errorCode,
43 const String& _driverSummary
44 );
45
46 virtual String toString() const;
47};
48
49class DCLCAPI SQLDriver : public Dll
50{
52private:
53 long __refCount;
54
55public:
56 long refCount() const { return __refCount; }
57 long addRef(); // new incremented __refCount
58 long release(); // new decremented __refCount
59public:
60 SQLDriver(const String& _name)
62
63 virtual ~SQLDriver();
64
65 void open(const String& _name)
67
68 void close()
70
71 // properties
72 const String& driverName() const { return __driverName; };
73 String getDriverSummary() const;
74
75 SQL::Connection* createConnection();
76 void destroyConnection(SQL::Connection* pConnection);
77
78protected:
81
82public:
83 static SQLDriver* getDriver(const String& _name)
85
86 static void closeDriver(SQLDriver* _pSQLDriver)
88};
89
90__DCL_END_NAMESPACE
91
92#endif // __DCL_SQLDRIVER_H__
#define DCLCAPI
Definition Config.h:95
#define __DCL_THROWS1(e)
Definition Config.h:152
#define DECLARE_CLASSINFO(class_name)
Definition Object.h:227
Definition Dll.h:28
virtual String toString() const
Definition Exception.cpp:40
Exception(Exception *_cause=NULL)
SQLDriverException(const String &_name, Exception *_cause)
static SQLDriver * getDriver(const String &_name) __DCL_THROWS1(SQLDriverException *)
long addRef()
static void closeDriver(SQLDriver *_pSQLDriver) __DCL_THROWS1(SQLDriverException *)
void close() __DCL_THROWS1(SQLDriverException *)
String __driverName
Definition SQLDriver.h:80
SQLDriver(const String &_name) __DCL_THROWS1(SQLDriverException *)
SQL::DRIVER_MODULE * __pModuleEntryPoint
Definition SQLDriver.h:79
const String & driverName() const
Definition SQLDriver.h:72
long release()
Definition SQLDriver.cpp:93
void open(const String &_name) __DCL_THROWS1(SQLDriverException *)
long refCount() const
Definition SQLDriver.h:56