Samchon Framework for CPP  1.0.0
SQLiBase.hpp
1 #pragma once
2 #include <samchon/API.hpp>
3 
4 #include <mutex>
5 
6 #ifdef _WIN32
7 # ifndef WIN32_LEAN_AND_MEAN
8 # define WIN32_LEAN_AND_MEAN
9 # endif
10 # include <Windows.h>
11 #endif
12 
13 #define _SQLNCLI_ODBC_
14 #include <sqltypes.h>
15 #include <sql.h>
16 #include <sqlext.h>
17 #include <sqlncli.h>
18 
19 namespace samchon
20 {
21 namespace library
22 {
23  class SQLi;
24  class SQLStatement;
25 
26 namespace base
27 {
28  class SQLiBase
29  {
30  friend class SQLi;
31  friend class SQLStatement;
32 
33  protected:
37  void *hdbc;
38 
42  SQLStatement *stmt;
43 
47  std::mutex stmtMutex;
48 
49  protected:
50  virtual auto getErrorMessage(short type) const -> std::string = 0;
51  };
52 };
53 };
54 };