CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes | Friends
ODRunConfigInfo Class Reference

#include <ODRunConfigInfo.h>

Inheritance diagram for ODRunConfigInfo:
IODConfig IDBObject

Public Member Functions

Tm getDBTime () const
 
int getDefaults () const
 
std::string getDescription () const
 
int getId () const
 
int getNumberOfEvents () const
 
int getNumberOfSequences () const
 
RunModeDef getRunModeDef () const
 
RunTypeDef getRunTypeDef () const
 
std::string getTable ()
 
std::string getTag () const
 
std::string getTriggerMode () const
 
std::string getUsageStatus () const
 
int getVersion () const
 
 ODRunConfigInfo ()
 
bool operator!= (const ODRunConfigInfo &r) const
 
bool operator== (const ODRunConfigInfo &r) const
 
void setDBTime (Tm x)
 
void setDefaults (int x)
 
void setDescription (std::string x)
 
void setId (int id)
 
void setNumberOfEvents (int x)
 
void setNumberOfSequences (int n)
 
void setRunModeDef (const RunModeDef runModeDef)
 
void setRunTypeDef (const RunTypeDef runTypeDef)
 
void setTag (std::string x)
 
void setTriggerMode (std::string x)
 
void setUsageStatus (std::string x)
 
void setVersion (int x)
 
 ~ODRunConfigInfo ()
 
- Public Member Functions inherited from IODConfig
std::string getConfigTag ()
 
void setConfigTag (std::string x)
 
- Public Member Functions inherited from IDBObject
oracle::occi::Connection * getConn () const
 
oracle::occi::Environment * getEnv () const
 
void setConnection (oracle::occi::Environment *env, oracle::occi::Connection *conn)
 
virtual ~IDBObject ()
 

Private Member Functions

void clear ()
 
void fetchData (ODRunConfigInfo *result) throw (std::runtime_error)
 
int fetchID () throw (std::runtime_error)
 
int fetchIDFromTagAndVersion () throw (std::runtime_error)
 
int fetchIDLast () throw (std::runtime_error)
 
int fetchNextId () throw (std::runtime_error)
 
void prepareWrite () throw (std::runtime_error)
 
void setByID (int id) throw (std::runtime_error)
 
int updateDefaultCycle () throw (std::runtime_error)
 
void writeDB () throw (std::runtime_error)
 

Private Attributes

Tm m_db_time
 
int m_defaults
 
std::string m_description
 
int m_ID
 
int m_num_events
 
int m_num_seq
 
RunModeDef m_runModeDef
 
RunTypeDef m_runTypeDef
 
std::string m_tag
 
std::string m_trigger_mode
 
std::string m_usage_status
 
int m_version
 

Friends

class EcalCondDBInterface
 

Additional Inherited Members

- Public Types inherited from IODConfig
typedef oracle::occi::Clob Clob
 
typedef oracle::occi::SQLException SQLException
 
typedef oracle::occi::Statement Statement
 
typedef oracle::occi::Stream Stream
 
- Public Attributes inherited from IODConfig
std::string m_config_tag
 
- Static Public Attributes inherited from IDBObject
static int const ECALDB_NROWS =1024
 
- Protected Member Functions inherited from IODConfig
void checkPrepare () throw (std::runtime_error)
 
void createReadStatement () throw (std::runtime_error)
 
void populateClob (Clob &clob, std::string fname, unsigned int bufsize) throw (std::runtime_error)
 
unsigned char * readClob (Clob &clob, int size) throw (std::runtime_error)
 
void setPrefetchRowCount (int ncount) throw (std::runtime_error)
 
void terminateReadStatement () throw (std::runtime_error)
 
void terminateWriteStatement () throw (std::runtime_error)
 
- Protected Member Functions inherited from IDBObject
void checkConnection () const throw (std::runtime_error)
 
- Protected Attributes inherited from IODConfig
Statementm_readStmt
 
Statementm_writeStmt
 
- Protected Attributes inherited from IDBObject
oracle::occi::Connection * m_conn
 
oracle::occi::Environment * m_env
 

Detailed Description

Definition at line 12 of file ODRunConfigInfo.h.

Constructor & Destructor Documentation

ODRunConfigInfo::ODRunConfigInfo ( )

Definition at line 12 of file ODRunConfigInfo.cc.

References NULL.

13 {
14  m_env = NULL;
15  m_conn = NULL;
16  m_ID = 0;
17  //
18  m_tag ="";
19  m_version=0;
20  m_num_seq=0;
23  m_defaults=0;
24  m_trigger_mode="";
25  m_num_events=0;
26 }
std::string m_trigger_mode
oracle::occi::Environment * m_env
Definition: IDBObject.h:38
oracle::occi::Connection * m_conn
Definition: IDBObject.h:39
RunModeDef m_runModeDef
std::string m_tag
#define NULL
Definition: scimark2.h:8
RunTypeDef m_runTypeDef
ODRunConfigInfo::~ODRunConfigInfo ( )

Definition at line 30 of file ODRunConfigInfo.cc.

30 {}

Member Function Documentation

void ODRunConfigInfo::clear ( void  )
private

Definition at line 294 of file ODRunConfigInfo.cc.

294  {
295  m_num_seq = 0;
298  m_defaults = 0;
299  m_trigger_mode = "";
300  m_num_events = 0;
301 }
std::string m_trigger_mode
RunModeDef m_runModeDef
RunTypeDef m_runTypeDef
void ODRunConfigInfo::fetchData ( ODRunConfigInfo result)
throw (std::runtime_error
)
private

Definition at line 303 of file ODRunConfigInfo.cc.

References gather_cfg::cout, DateHandler::dateToTm(), alignCSCRings::e, and query::result.

305 {
306  this->checkConnection();
307  DateHandler dh(m_env, m_conn);
308  // result->clear();
309 
310  if(result->getId()==0){
311  //throw(std::runtime_error("FEConfigMainInfo::fetchData(): no Id defined for this FEConfigMainInfo "));
312  result->fetchID();
313  }
314  try {
315  m_readStmt->setSQL("SELECT config_id, tag, version, run_type_def_id, run_mode_def_id, \
316  num_of_sequences, description, defaults, trg_mode, num_of_events, db_timestamp, usage_status \
317  FROM ECAL_RUN_CONFIGURATION_DAT WHERE config_id = :1 ");
318  m_readStmt->setInt(1, result->getId());
319 
320  ResultSet* rset = m_readStmt->executeQuery();
321  rset->next();
322 
323  result->setId( rset->getInt(1) );
324  result->setTag( rset->getString(2) );
325  result->setVersion( rset->getInt(3) );
326  // RunTypeDef myRunType = rset->getInt(4);
327  // result->setRunTypeDef( myRunType );
328  // RunModeDef myRunMode = rset->getInt(5);
329  // result->setRunModeDef( myRunMode );
330  result->setNumberOfSequences(rset->getInt(6) );
331  result->setDescription( rset->getString(7) );
332  result->setDefaults( rset->getInt(8) );
333  result->setTriggerMode( rset->getString(9) );
334  result->setNumberOfEvents( rset->getInt(10) );
335  Date dbdate = rset->getDate(11);
336  result->setDBTime(dh.dateToTm( dbdate ));
337  result->setUsageStatus( rset->getString(12) );
338 
339  } catch (SQLException &e) {
340  cout << " ODRunConfigInfo::fetchData(): " << e.getMessage() << endl;
341  throw(std::runtime_error("ODRunConfigInfo::fetchData(): "+e.getMessage()));
342  }
343 }
void setDBTime(Tm x)
oracle::occi::Environment * m_env
Definition: IDBObject.h:38
oracle::occi::Connection * m_conn
Definition: IDBObject.h:39
void setDefaults(int x)
oracle::occi::SQLException SQLException
Definition: HcalDbOmds.cc:22
void setUsageStatus(std::string x)
void setDescription(std::string x)
void setVersion(int x)
int getId() const
oracle::occi::ResultSet ResultSet
Definition: HcalDbOmds.cc:21
void setId(int id)
void setNumberOfSequences(int n)
void setTriggerMode(std::string x)
void setTag(std::string x)
Statement * m_readStmt
Definition: IODConfig.h:37
tuple cout
Definition: gather_cfg.py:121
void checkConnection() const
Definition: IDBObject.h:41
void setNumberOfEvents(int x)
int ODRunConfigInfo::fetchID ( )
throw (std::runtime_error
)
private

Definition at line 75 of file ODRunConfigInfo.cc.

References alignCSCRings::e.

77 {
78  // Return from memory if available
79  if (m_ID>0) {
80  return m_ID;
81  }
82 
83  this->checkConnection();
84 
85 
87 
88  try {
89  Statement* stmt = m_conn->createStatement();
90  stmt->setSQL("SELECT config_id from ECAL_RUN_CONFIGURATION_DAT "
91  "WHERE tag = :tag "
92  " and version = :version " );
93  stmt->setString(1, m_tag);
94  stmt->setInt(2, m_version);
95 
96  ResultSet* rset = stmt->executeQuery();
97  if (rset->next()) {
98  m_ID = rset->getInt(1);
99  } else {
100  m_ID = 0;
101  }
102  m_conn->terminateStatement(stmt);
103  } catch (SQLException &e) {
104  throw(std::runtime_error("ODRunConfigInfo::fetchID: "+e.getMessage()));
105  }
106  setByID(m_ID);
107  return m_ID;
108 }
oracle::occi::Environment * m_env
Definition: IDBObject.h:38
oracle::occi::Connection * m_conn
Definition: IDBObject.h:39
void setByID(int id)
std::string m_tag
oracle::occi::SQLException SQLException
Definition: HcalDbOmds.cc:22
oracle::occi::Statement Statement
Definition: IODConfig.h:23
oracle::occi::ResultSet ResultSet
Definition: HcalDbOmds.cc:21
void checkConnection() const
Definition: IDBObject.h:41
int ODRunConfigInfo::fetchIDFromTagAndVersion ( )
throw (std::runtime_error
)
private

Definition at line 140 of file ODRunConfigInfo.cc.

142 {
143  fetchID();
144  return m_ID;
145 }
int ODRunConfigInfo::fetchIDLast ( )
throw (std::runtime_error
)
private

Definition at line 112 of file ODRunConfigInfo.cc.

References alignCSCRings::e.

114 {
115 
116  this->checkConnection();
117 
118  DateHandler dh(m_env, m_conn);
119 
120  try {
121  Statement* stmt = m_conn->createStatement();
122  stmt->setSQL("SELECT max(config_id) FROM ecal_run_configuration_dat " );
123  ResultSet* rset = stmt->executeQuery();
124 
125  if (rset->next()) {
126  m_ID = rset->getInt(1);
127  } else {
128  m_ID = 0;
129  }
130  m_conn->terminateStatement(stmt);
131  } catch (SQLException &e) {
132  throw(std::runtime_error("ODRunConfigInfo::fetchIDLast: "+e.getMessage()));
133  }
134 
135  setByID(m_ID);
136  return m_ID;
137 }
oracle::occi::Environment * m_env
Definition: IDBObject.h:38
oracle::occi::Connection * m_conn
Definition: IDBObject.h:39
void setByID(int id)
oracle::occi::SQLException SQLException
Definition: HcalDbOmds.cc:22
oracle::occi::Statement Statement
Definition: IODConfig.h:23
oracle::occi::ResultSet ResultSet
Definition: HcalDbOmds.cc:21
void checkConnection() const
Definition: IDBObject.h:41
int ODRunConfigInfo::fetchNextId ( )
throw (std::runtime_error
)
private

Definition at line 54 of file ODRunConfigInfo.cc.

References alignCSCRings::e, and query::result.

54  {
55 
56  int result=0;
57  try {
58  this->checkConnection();
59 
60  m_readStmt = m_conn->createStatement();
61  m_readStmt->setSQL("select ecal_run_sq.NextVal from dual");
62  ResultSet* rset = m_readStmt->executeQuery();
63  while (rset->next ()){
64  result= rset->getInt(1);
65  }
66  m_conn->terminateStatement(m_readStmt);
67  return result;
68 
69  } catch (SQLException &e) {
70  throw(std::runtime_error("ODDCCConfig::fetchNextId(): "+e.getMessage()));
71  }
72 
73 }
oracle::occi::Connection * m_conn
Definition: IDBObject.h:39
oracle::occi::SQLException SQLException
Definition: HcalDbOmds.cc:22
tuple result
Definition: query.py:137
oracle::occi::ResultSet ResultSet
Definition: HcalDbOmds.cc:21
Statement * m_readStmt
Definition: IODConfig.h:37
void checkConnection() const
Definition: IDBObject.h:41
Tm ODRunConfigInfo::getDBTime ( ) const
inline

Definition at line 26 of file ODRunConfigInfo.h.

References m_db_time.

26 { return m_db_time;}
int ODRunConfigInfo::getDefaults ( ) const
inline

Definition at line 41 of file ODRunConfigInfo.h.

References m_defaults.

41 { return m_defaults;}
std::string ODRunConfigInfo::getDescription ( ) const
inline

Definition at line 32 of file ODRunConfigInfo.h.

References m_description.

32 { return m_description;}
std::string m_description
int ODRunConfigInfo::getId ( ) const
inline

Definition at line 21 of file ODRunConfigInfo.h.

References m_ID.

Referenced by popcon::EcalSRPHandler::getNewObjects().

21 { return m_ID; }
int ODRunConfigInfo::getNumberOfEvents ( ) const
inline

Definition at line 47 of file ODRunConfigInfo.h.

References m_num_events.

47 { return m_num_events ;}
int ODRunConfigInfo::getNumberOfSequences ( ) const
inline

Definition at line 38 of file ODRunConfigInfo.h.

References m_num_seq.

38 {return m_num_seq; }
RunModeDef ODRunConfigInfo::getRunModeDef ( ) const

Definition at line 44 of file ODRunConfigInfo.cc.

44 { return m_runModeDef;}
RunModeDef m_runModeDef
RunTypeDef ODRunConfigInfo::getRunTypeDef ( ) const

Definition at line 35 of file ODRunConfigInfo.cc.

35 { return m_runTypeDef;}
RunTypeDef m_runTypeDef
std::string ODRunConfigInfo::getTable ( )
inlinevirtual

Implements IODConfig.

Definition at line 18 of file ODRunConfigInfo.h.

18 { return "ECAL_RUN_CONFIGURATION_DAT"; }
std::string ODRunConfigInfo::getTag ( void  ) const
inline

Definition at line 29 of file ODRunConfigInfo.h.

References m_tag.

29 { return m_tag;}
std::string m_tag
std::string ODRunConfigInfo::getTriggerMode ( ) const
inline

Definition at line 44 of file ODRunConfigInfo.h.

References m_trigger_mode.

44 { return m_trigger_mode;}
std::string m_trigger_mode
std::string ODRunConfigInfo::getUsageStatus ( ) const
inline

Definition at line 50 of file ODRunConfigInfo.h.

References m_usage_status.

50 { return m_usage_status;}
std::string m_usage_status
int ODRunConfigInfo::getVersion ( ) const
inline

Definition at line 35 of file ODRunConfigInfo.h.

References m_version.

35 {return m_version; }
bool ODRunConfigInfo::operator!= ( const ODRunConfigInfo r) const
inline

Definition at line 61 of file ODRunConfigInfo.h.

References alignCSCRings::r.

61 { return !(*this == r); }
bool ODRunConfigInfo::operator== ( const ODRunConfigInfo r) const
inline

Definition at line 60 of file ODRunConfigInfo.h.

References m_ID.

60 { return (m_ID == r.m_ID ); }
void ODRunConfigInfo::prepareWrite ( )
throw (std::runtime_error
)
privatevirtual

Implements IODConfig.

Definition at line 192 of file ODRunConfigInfo.cc.

References alignCSCRings::e.

194 {
195  this->checkConnection();
196 
197  int next_id=fetchNextId();
198 
199 
200 
201 
202  try {
203  m_writeStmt = m_conn->createStatement();
204  m_writeStmt->setSQL("INSERT INTO ECAL_RUN_CONFIGURATION_DAT (CONFIG_ID, tag, version, run_type_def_id, "
205  " run_mode_def_id, num_of_sequences, defaults, trg_mode, num_of_events, description, usage_status ) "
206  " VALUES (:1, :2, :3 , :4, :5, :6 ,:7, :8, :9, :10 , :11)");
207 
208  m_writeStmt->setInt(1, next_id);
209  m_ID=next_id;
210 
211  } catch (SQLException &e) {
212  throw(std::runtime_error("ODRunConfigInfo::prepareWrite(): "+e.getMessage()));
213  }
214 }
oracle::occi::Connection * m_conn
Definition: IDBObject.h:39
Statement * m_writeStmt
Definition: IODConfig.h:36
oracle::occi::SQLException SQLException
Definition: HcalDbOmds.cc:22
void checkConnection() const
Definition: IDBObject.h:41
void ODRunConfigInfo::setByID ( int  id)
throw (std::runtime_error
)
private

Definition at line 149 of file ODRunConfigInfo.cc.

References DateHandler::dateToTm(), alignCSCRings::e, and errorMatrix2Lands_multiChannel::id.

151 {
152  this->checkConnection();
153 
154  DateHandler dh(m_env, m_conn);
155 
156  try {
157  Statement* stmt = m_conn->createStatement();
158 
159  stmt->setSQL("SELECT tag, version, run_type_def_id, run_mode_def_id, num_of_sequences, description, defaults,"
160  " trg_mode,num_of_events, db_timestamp, usage_status"
161  " FROM ECAL_RUN_CONFIGURATION_DAT WHERE config_id = :1");
162  stmt->setInt(1, id);
163 
164  ResultSet* rset = stmt->executeQuery();
165  if (rset->next()) {
166  m_tag= rset->getString(1);
167  m_version= rset->getInt(2);
168  int run_type_id=rset->getInt(3);
169  int run_mode_id=rset->getInt(4);
170  m_num_seq=rset->getInt(5);
171  m_description= rset->getString(6);
172  m_defaults= rset->getInt(7);
173  m_trigger_mode= rset->getString(8);
174  m_num_events= rset->getInt(9);
175  Date dbdate = rset->getDate(10);
176  m_db_time = dh.dateToTm( dbdate );
177  m_ID = id;
179  m_runModeDef.setByID(run_mode_id);
181  m_runTypeDef.setByID(run_type_id);
182  m_usage_status=rset->getString(11);
183  } else {
184  throw(std::runtime_error("ODRunConfigInfo::setByID: Given config_id is not in the database"));
185  }
186  m_conn->terminateStatement(stmt);
187  } catch (SQLException &e) {
188  throw(std::runtime_error("ODRunConfigInfo::setByID: "+e.getMessage()));
189  }
190 }
std::string m_trigger_mode
oracle::occi::Environment * m_env
Definition: IDBObject.h:38
oracle::occi::Connection * m_conn
Definition: IDBObject.h:39
RunModeDef m_runModeDef
std::string m_tag
std::string m_description
oracle::occi::SQLException SQLException
Definition: HcalDbOmds.cc:22
void setByID(int id)
Definition: RunModeDef.cc:80
RunTypeDef m_runTypeDef
std::string m_usage_status
oracle::occi::Statement Statement
Definition: IODConfig.h:23
oracle::occi::ResultSet ResultSet
Definition: HcalDbOmds.cc:21
void setByID(int id)
Definition: RunTypeDef.cc:84
void setConnection(oracle::occi::Environment *env, oracle::occi::Connection *conn)
Definition: IDBObject.h:23
void checkConnection() const
Definition: IDBObject.h:41
void ODRunConfigInfo::setDBTime ( Tm  x)
inline

Definition at line 25 of file ODRunConfigInfo.h.

References m_db_time, and vdt::x.

25 { m_db_time=x; }
x
Definition: VDTMath.h:216
void ODRunConfigInfo::setDefaults ( int  x)
inline

Definition at line 40 of file ODRunConfigInfo.h.

References m_defaults, and vdt::x.

40 { m_defaults = x;}
x
Definition: VDTMath.h:216
void ODRunConfigInfo::setDescription ( std::string  x)
inline

Definition at line 31 of file ODRunConfigInfo.h.

References m_description, and vdt::x.

31 { m_description = x;}
std::string m_description
x
Definition: VDTMath.h:216
void ODRunConfigInfo::setId ( int  id)
inline
void ODRunConfigInfo::setNumberOfEvents ( int  x)
inline

Definition at line 46 of file ODRunConfigInfo.h.

References m_num_events, and vdt::x.

46 { m_num_events = x ;}
x
Definition: VDTMath.h:216
void ODRunConfigInfo::setNumberOfSequences ( int  n)
inline

Definition at line 37 of file ODRunConfigInfo.h.

References m_num_seq, and n.

37 { m_num_seq = n; }
void ODRunConfigInfo::setRunModeDef ( const RunModeDef  runModeDef)

Definition at line 45 of file ODRunConfigInfo.cc.

46 {
47  if (runModeDef != m_runModeDef) {
48  m_ID = 0;
49  m_runModeDef = runModeDef;
50  }
51 }
RunModeDef m_runModeDef
void ODRunConfigInfo::setRunTypeDef ( const RunTypeDef  runTypeDef)

Definition at line 36 of file ODRunConfigInfo.cc.

37 {
38  if (runTypeDef != m_runTypeDef) {
39  m_ID = 0;
40  m_runTypeDef = runTypeDef;
41  }
42 }
RunTypeDef m_runTypeDef
void ODRunConfigInfo::setTag ( std::string  x)
inline

Definition at line 28 of file ODRunConfigInfo.h.

References m_tag, and vdt::x.

Referenced by popcon::EcalSRPHandler::getNewObjects().

28 { m_tag = x; }
std::string m_tag
x
Definition: VDTMath.h:216
void ODRunConfigInfo::setTriggerMode ( std::string  x)
inline

Definition at line 43 of file ODRunConfigInfo.h.

References m_trigger_mode, and vdt::x.

43 { m_trigger_mode = x;}
std::string m_trigger_mode
x
Definition: VDTMath.h:216
void ODRunConfigInfo::setUsageStatus ( std::string  x)
inline

Definition at line 49 of file ODRunConfigInfo.h.

References m_usage_status, and vdt::x.

49 { m_usage_status = x;}
std::string m_usage_status
x
Definition: VDTMath.h:216
void ODRunConfigInfo::setVersion ( int  x)
inline

Definition at line 34 of file ODRunConfigInfo.h.

References m_version, and vdt::x.

Referenced by popcon::EcalSRPHandler::getNewObjects().

34 { m_version = x; }
x
Definition: VDTMath.h:216
int ODRunConfigInfo::updateDefaultCycle ( )
throw (std::runtime_error
)
private

Definition at line 265 of file ODRunConfigInfo.cc.

References alignCSCRings::e.

267 {
268  this->checkConnection();
269 
270  // Check if this has already been written
271  if(!this->fetchID()){
272  this->writeDB();
273  }
274 
275 
276  try {
277  Statement* stmt = m_conn->createStatement();
278 
279  stmt->setSQL("UPDATE ecal_run_configuration_dat set defaults=:1 where config_id=:2 " );
280 
281  stmt->setInt(1, m_defaults);
282  stmt->setInt(2, m_ID);
283 
284  stmt->executeUpdate();
285 
286  m_conn->terminateStatement(stmt);
287  } catch (SQLException &e) {
288  throw(std::runtime_error("ODRunConfigInfo::writeDB: "+e.getMessage()));
289  }
290 
291  return m_ID;
292 }
oracle::occi::Connection * m_conn
Definition: IDBObject.h:39
oracle::occi::SQLException SQLException
Definition: HcalDbOmds.cc:22
oracle::occi::Statement Statement
Definition: IODConfig.h:23
void checkConnection() const
Definition: IDBObject.h:41
void ODRunConfigInfo::writeDB ( )
throw (std::runtime_error
)
private

Definition at line 217 of file ODRunConfigInfo.cc.

References gather_cfg::cout, and alignCSCRings::e.

219 {
220  this->checkConnection();
221  this->checkPrepare();
222 
223  // Validate the data, use infinity-till convention
224  DateHandler dh(m_env, m_conn);
225 
226  try {
227 
228  // get the run mode
230  int run_mode_id = m_runModeDef.fetchID();
231 
232  // get the run type
234  int run_type_id = m_runTypeDef.fetchID();
235 
236  // now insert
237 
238  m_writeStmt->setString(2, this->getTag());
239  m_writeStmt->setInt(3, this->getVersion());
240  m_writeStmt->setInt(4, run_type_id);
241  m_writeStmt->setInt(5, run_mode_id);
242  m_writeStmt->setInt(6, this->getNumberOfSequences());
243  m_writeStmt->setInt(7, this->getDefaults());
244  m_writeStmt->setString(8, this->getTriggerMode());
245  m_writeStmt->setInt(9, this->getNumberOfEvents());
246  m_writeStmt->setString(10, this->getDescription());
247  m_writeStmt->setString(11, this->getUsageStatus());
248 
249  m_writeStmt->executeUpdate();
250 
251  } catch (SQLException &e) {
252  throw(std::runtime_error("ODRunConfigInfo::writeDB: "+e.getMessage()));
253  }
254  // Now get the ID
255  if (!this->fetchID()) {
256  throw(std::runtime_error("ODRunConfigInfo::writeDB Failed to write"));
257  }
258 
259  this->setByID(m_ID);
260 
261  cout<< "ODRunConfigInfo::writeDB>> done inserting ODRunConfigInfo with id="<<m_ID<<endl;
262 }
std::string getTriggerMode() const
oracle::occi::Environment * m_env
Definition: IDBObject.h:38
oracle::occi::Connection * m_conn
Definition: IDBObject.h:39
Statement * m_writeStmt
Definition: IODConfig.h:36
void setByID(int id)
int getDefaults() const
RunModeDef m_runModeDef
int fetchID()
Definition: RunTypeDef.cc:50
std::string getDescription() const
oracle::occi::SQLException SQLException
Definition: HcalDbOmds.cc:22
int fetchID()
Definition: RunModeDef.cc:46
RunTypeDef m_runTypeDef
int getVersion() const
int getNumberOfEvents() const
std::string getTag() const
void checkPrepare()
Definition: IODConfig.h:39
int getNumberOfSequences() const
tuple cout
Definition: gather_cfg.py:121
std::string getUsageStatus() const
void setConnection(oracle::occi::Environment *env, oracle::occi::Connection *conn)
Definition: IDBObject.h:23
void checkConnection() const
Definition: IDBObject.h:41

Friends And Related Function Documentation

friend class EcalCondDBInterface
friend

Definition at line 14 of file ODRunConfigInfo.h.

Member Data Documentation

Tm ODRunConfigInfo::m_db_time
private

Definition at line 66 of file ODRunConfigInfo.h.

Referenced by getDBTime(), and setDBTime().

int ODRunConfigInfo::m_defaults
private

Definition at line 73 of file ODRunConfigInfo.h.

Referenced by getDefaults(), and setDefaults().

std::string ODRunConfigInfo::m_description
private

Definition at line 72 of file ODRunConfigInfo.h.

Referenced by getDescription(), and setDescription().

int ODRunConfigInfo::m_ID
private

Definition at line 65 of file ODRunConfigInfo.h.

Referenced by getId(), operator==(), and setId().

int ODRunConfigInfo::m_num_events
private

Definition at line 75 of file ODRunConfigInfo.h.

Referenced by getNumberOfEvents(), and setNumberOfEvents().

int ODRunConfigInfo::m_num_seq
private

Definition at line 71 of file ODRunConfigInfo.h.

Referenced by getNumberOfSequences(), and setNumberOfSequences().

RunModeDef ODRunConfigInfo::m_runModeDef
private

Definition at line 69 of file ODRunConfigInfo.h.

RunTypeDef ODRunConfigInfo::m_runTypeDef
private

Definition at line 70 of file ODRunConfigInfo.h.

std::string ODRunConfigInfo::m_tag
private

Definition at line 67 of file ODRunConfigInfo.h.

Referenced by getTag(), and setTag().

std::string ODRunConfigInfo::m_trigger_mode
private

Definition at line 74 of file ODRunConfigInfo.h.

Referenced by getTriggerMode(), and setTriggerMode().

std::string ODRunConfigInfo::m_usage_status
private

Definition at line 76 of file ODRunConfigInfo.h.

Referenced by getUsageStatus(), and setUsageStatus().

int ODRunConfigInfo::m_version
private

Definition at line 68 of file ODRunConfigInfo.h.

Referenced by getVersion(), and setVersion().