DCL 4.0
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
19class SQLDriver;
21{
23public:
24 enum ErrorCode
25 {
26 eInvalidDriverModule, // DCLDynamicEntryPoint가 유효하지 않다.
27 eInvalidVersion, // 유효하지 않은 DCL_SQL_VERSION 이다.
28 eInitializeFail, // 모듈초기화 callback 실패
29 eCleanupFail // cleanup callback fail
30 };
31
32 String __name;
33 ErrorCode __errorCode;
34 String __driverSummary;
35public:
36 SQLDriverException(const String& _name, Exception* _cause);
37 SQLDriverException(const String& _name, ErrorCode _errorCode);
38 SQLDriverException(const String& _name, ErrorCode _errorCode,
39 const String& _driverSummary);
40
41 virtual String toString() const;
42};
43
44class DCLCAPI SQLDriver : public Dll
45{
47private:
48 long __refCount;
49
50public:
51 long refCount() const { return __refCount; }
52 long addRef(); // new incremented __refCount
53 long release(); // new decremented __refCount
54public:
55 SQLDriver(const String& _name)
57
58 virtual ~SQLDriver();
59
60 void open(const String& _name)
62
63 void close()
65
66 // properties
67 const String& driverName() const { return __driverName; };
68 String getDriverSummary() const;
69
70 SQL::Connection* createConnection();
71 void destroyConnection(SQL::Connection* pConnection);
72
73protected:
76
77public:
78 static SQLDriver* getDriver(const String& _name)
80
81 static void closeDriver(SQLDriver* _pSQLDriver)
83};
84
85__DCL_END_NAMESPACE
86
87#endif // __DCL_SQLDRIVER_H__
#define DCLCAPI
Definition Config.h:100
#define __DCL_THROWS1(e)
Definition Config.h:167
#define DECLARE_CLASSINFO(class_name)
Definition Object.h:210
buf release()
Definition Dll.h:29
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:75
SQLDriver(const String &_name) __DCL_THROWS1(SQLDriverException *)
SQL::DRIVER_MODULE * __pModuleEntryPoint
Definition SQLDriver.h:74
const String & driverName() const
Definition SQLDriver.h:67
void open(const String &_name) __DCL_THROWS1(SQLDriverException *)
long refCount() const
Definition SQLDriver.h:51