Samchon Framework for CPP  1.0.0
SQLi.hpp
1 #pragma once
2 #include <samchon/API.hpp>
3 
4 #include <memory>
5 #include <mutex>
6 #include <string>
7 
8 namespace samchon
9 {
10 namespace library
11 {
12  class SQLStatement;
13 
42  class SAMCHON_FRAMEWORK_API SQLi
43  {
44  friend class SQLStatement;
45 
46  protected:
55  std::string driver;
56 
65  int port;
66 
70  virtual auto getErrorMessage(short type) const->std::string;
71 
72  private:
76  void *hdbc;
77 
82 
86  std::mutex stmtMutex;
87 
88  public:
95  SQLi(const std::string &driver, int port);
96  virtual ~SQLi();
97 
108  virtual void connect
109  (
110  const std::string &ip, const std::string &db,
111  const std::string &id, const std::string &pwd
112  );
113 
117  virtual void disconnect();
118 
128  virtual auto createStatement()->std::shared_ptr<SQLStatement>;
129  };
130 };
131 };
std::mutex stmtMutex
Mutex ensuring concurrency with SQLStatement.
Definition: SQLi.hpp:86
void * hdbc
Handler of DB-connector.
Definition: SQLi.hpp:76
std::string driver
Driver; name of DBMS used for connection.
Definition: SQLi.hpp:55
int port
Port number of DBMS.
Definition: SQLi.hpp:65
A SQL interface; DBMS connector.
Definition: SQLi.hpp:42
SQLStatement * stmt
SQLStatement&#39;s pointer linked with the SQLi.
Definition: SQLi.hpp:81
Top level namespace of products built from samchon.
Definition: ByteArray.hpp:7