ANNA Suite  2020b
Multipurpose development suite for Telco applications
Connection.hpp
Go to the documentation of this file.
1 // ANNA - Anna is Not Nothingness Anymore //
2 // //
3 // (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo //
4 // //
5 // See project site at http://redmine.teslayout.com/projects/anna-suite //
6 // See accompanying file LICENSE or copy at http://www.teslayout.com/projects/public/anna.LICENSE //
7 
8 
9 #ifndef anna_dbms_oracle_Connection_hpp
10 #define anna_dbms_oracle_Connection_hpp
11 
12 struct OCIServer;
13 struct OCISession;
14 struct OCISvcCtx;
15 
16 #include <anna/dbms/Connection.hpp>
18 
19 namespace anna {
20 
21 namespace dbms {
22 
23 class Database;
24 
25 namespace oracle {
26 
27 class Database;
28 
39 class Connection : public dbms::Connection {
40 public:
45  std::string asString() const ;
46 
51  operator OCISvcCtx*() { return a_context; }
52 
53 private:
54  Database& a_oracleDatabase;
55  OCISvcCtx* a_context;
56  OCISession* a_session;
57  OCIServer* a_server;
58 
59  Connection(Database& database, const std::string& name, const char* user, const char* password);
60  bool isAvailable() const noexcept(false) { return a_context != NULL && a_session != NULL && a_server != NULL; }
61  void do_commit() noexcept(false);
62  void do_rollback() ;
63  void open() noexcept(false);
64  void close() ;
65 
67 };
68 
69 }
70 }
71 }
72 
73 #endif
Definition: Connection.hpp:39
Definition: Connection.hpp:38
std::string asString() const
Definition: app.hpp:12
Definition: Database.hpp:30