OnlineDB
EcalCondDB
interface
EcalDBConnection.h
Go to the documentation of this file.
1
#ifndef ECALDBCONNECTION_HH
2
#define ECALDBCONNECTION_HH
3
4
#include "
OnlineDB/Oracle/interface/Oracle.h
"
5
#include <string>
6
#include <stdexcept>
7
#include <iostream>
8
9
#include "
OnlineDB/EcalCondDB/interface/DateHandler.h
"
10
15
class
EcalDBConnection
{
16
public
:
17
/******************\
18
- public methods -
19
\******************/
20
25
EcalDBConnection
(
std::string
host
,
std::string
sid
,
std::string
user
,
std::string
pass
,
int
port
= 1521) noexcept(
26
false
);
27
32
EcalDBConnection
(
std::string
sid
,
std::string
user
,
std::string
pass
) noexcept(
false
);
33
37
virtual
~EcalDBConnection
() noexcept(
false
);
38
42
inline
oracle::occi::Statement*
createStatement
() {
43
std::cout
<<
"Creating statement"
<< std::endl;
44
return
conn
->createStatement();
45
}
46
47
inline
void
terminateStatement
(oracle::occi::Statement*
stmt
) {
48
std::cout
<<
"Creating statement"
<< std::endl;
49
conn
->terminateStatement(
stmt
);
50
}
51
55
inline
void
commit
() {
conn
->commit(); }
56
inline
void
rollback
() {
conn
->rollback(); }
57
61
inline
oracle::occi::Clob
getClobLocator
() {
return
oracle::occi::Clob(
conn
); }
62
63
oracle::occi::Environment*
getEnv
()
const
{
return
env
; };
64
oracle::occi::Connection*
getConn
()
const
{
return
conn
; };
65
66
protected
:
67
/***********************\
68
- protected variables -
69
\***********************/
70
71
oracle::occi::Environment*
env
;
72
oracle::occi::Connection*
conn
;
73
oracle::occi::Statement*
stmt
;
74
75
std::string
host
;
76
int
port
;
77
std::string
sid
;
78
std::string
user
;
79
std::string
pass
;
80
};
81
82
#endif
gather_cfg.cout
cout
Definition:
gather_cfg.py:144
EcalDBConnection::port
int port
Definition:
EcalDBConnection.h:76
EcalDBConnection::host
std::string host
Definition:
EcalDBConnection.h:75
EcalDBConnection::EcalDBConnection
EcalDBConnection(std::string host, std::string sid, std::string user, std::string pass, int port=1521) noexcept(false)
EcalDBConnection::getEnv
oracle::occi::Environment * getEnv() const
Definition:
EcalDBConnection.h:63
EcalDBConnection::pass
std::string pass
Definition:
EcalDBConnection.h:79
EcalDBConnection::stmt
oracle::occi::Statement * stmt
Definition:
EcalDBConnection.h:73
EcalDBConnection::createStatement
oracle::occi::Statement * createStatement()
Definition:
EcalDBConnection.h:42
EcalDBConnection::getConn
oracle::occi::Connection * getConn() const
Definition:
EcalDBConnection.h:64
EcalDBConnection::sid
std::string sid
Definition:
EcalDBConnection.h:77
EcalDBConnection::~EcalDBConnection
virtual ~EcalDBConnection() noexcept(false)
Definition:
EcalDBConnection.cc:50
EcalDBConnection::getClobLocator
oracle::occi::Clob getClobLocator()
Definition:
EcalDBConnection.h:61
EcalDBConnection::rollback
void rollback()
Definition:
EcalDBConnection.h:56
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
EcalDBConnection::commit
void commit()
Definition:
EcalDBConnection.h:55
EcalDBConnection::env
oracle::occi::Environment * env
Definition:
EcalDBConnection.h:64
EcalDBConnection::terminateStatement
void terminateStatement(oracle::occi::Statement *stmt)
Definition:
EcalDBConnection.h:47
Oracle.h
DateHandler.h
EcalDBConnection::user
std::string user
Definition:
EcalDBConnection.h:78
EcalDBConnection::conn
oracle::occi::Connection * conn
Definition:
EcalDBConnection.h:72
EcalDBConnection
Definition:
EcalDBConnection.h:15
Generated for CMSSW Reference Manual by
1.8.16