CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EcalDBConnection.h
Go to the documentation of this file.
1 #ifndef ECALDBCONNECTION_HH
2 #define ECALDBCONNECTION_HH
3 
5 #include <string>
6 #include <stdexcept>
7 #include <iostream>
8 
10 
11 
17  public:
18 
19  /******************\
20  - public methods -
21  \******************/
22 
31  int port = 1521 )
32  throw(std::runtime_error);
33 
34 
35 
41  std::string user,
42  std::string pass )
43  throw(std::runtime_error);
44 
45 
46 
50  virtual ~EcalDBConnection() throw(std::runtime_error);
51 
55  inline oracle::occi::Statement* createStatement()
56  {
57  std::cout << "Creating statement" << std::endl;
58  return conn->createStatement();
59  }
60 
61  inline void terminateStatement(oracle::occi::Statement* stmt)
62  {
63  std::cout << "Creating statement" << std::endl;
64  conn->terminateStatement(stmt);
65  }
66 
70  inline void commit() { conn->commit(); }
71  inline void rollback() { conn->rollback(); }
72 
76  inline oracle::occi::Clob getClobLocator()
77  {
78  return oracle::occi::Clob(conn);
79  }
80 
81  oracle::occi::Environment* getEnv() const { return env; };
82  oracle::occi::Connection* getConn() const { return conn; };
83 
84  protected:
85 
86  /***********************\
87  - protected variables -
88  \***********************/
89 
90  oracle::occi::Environment* env;
91  oracle::occi::Connection* conn;
92  oracle::occi::Statement* stmt;
93 
95  int port;
99 
100 };
101 
102 #endif
oracle::occi::Environment * env
oracle::occi::Environment * getEnv() const
oracle::occi::Connection * getConn() const
oracle::occi::Connection * conn
void terminateStatement(oracle::occi::Statement *stmt)
virtual ~EcalDBConnection()
oracle::occi::Statement * stmt
tuple cout
Definition: gather_cfg.py:145
EcalDBConnection(std::string host, std::string sid, std::string user, std::string pass, int port=1521)
oracle::occi::Statement * createStatement()
oracle::occi::Clob getClobLocator()