ANNA Suite  2020b
Multipurpose development suite for Telco applications
Statement.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_Statement_hpp
10 #define anna_dbms_oracle_Statement_hpp
11 
12 #include <anna/dbms/Statement.hpp>
13 
14 struct OCIStmt;
15 struct OCIError;
16 
17 namespace anna {
18 
19 namespace dbms {
20 
21 class Connection;
22 
23 namespace oracle {
24 
35 class Statement : public dbms::Statement {
36 public:
40  virtual ~Statement();
41 
46  operator OCIStmt*() { return a_ociStmt; }
47 
48 private:
49  OCIStmt* a_ociStmt;
50  OCIError* a_ociError;
51  bool a_firstFetch;
52 
53  Statement(Database& database, const char* name, const char* expression, const bool isCritical) :
54  dbms::Statement(database, name, expression, isCritical),
55  a_ociStmt(NULL),
56  a_ociError(NULL) {}
57 
58  Statement(Database& database, const char* name, const std::string& expression, const bool isCritical) :
59  dbms::Statement(database, name, expression, isCritical),
60  a_ociStmt(NULL),
61  a_ociError(NULL) {}
62 
63  void prepare(dbms::Connection* connection) noexcept(false);
64  dbms::ResultCode execute(dbms::Connection* connection) noexcept(false);
65  bool fetch() noexcept(false);
66 
67  friend class Database;
68 };
69 
70 }
71 }
72 }
73 
74 #endif
75 
Definition: Connection.hpp:38
Definition: Statement.hpp:35
Definition: Statement.hpp:43
bool isCritical() const
Definition: Statement.hpp:72
Definition: app.hpp:12
Definition: ResultCode.hpp:29
Definition: Database.hpp:30