9 using namespace oracle::occi;
31 throw(std::runtime_error)
33 this->checkConnection();
36 m_writeStmt = m_conn->createStatement();
37 m_writeStmt->setSQL(
"INSERT INTO run_FEConfig_dat (iov_id, logic_id, "
39 "VALUES (:iov_id, :logic_id, "
42 throw(std::runtime_error(
"RunFEConfigDat::prepareWrite(): "+e.getMessage()));
49 throw(std::runtime_error)
51 this->checkConnection();
54 int iovID =
iov->fetchID();
55 if (!iovID) {
throw(std::runtime_error(
"RunFEConfigDat::writeDB: IOV not in DB")); }
57 int logicID = ecid->getLogicID();
58 if (!logicID) {
throw(std::runtime_error(
"RunFEConfigDat::writeDB: Bad EcalLogicID")); }
61 m_writeStmt->setInt(1, iovID);
62 m_writeStmt->setInt(2, logicID);
63 m_writeStmt->setInt(3, item->getConfigId());
66 m_writeStmt->executeUpdate();
68 throw(std::runtime_error(
"RunFEConfigDat::writeDB(): "+e.getMessage()));
75 throw(std::runtime_error)
77 this->checkConnection();
80 iov->setConnection(m_env, m_conn);
81 int iovID =
iov->fetchID();
89 createReadStatement();
90 m_readStmt->setSQL(
"SELECT cv.name, cv.logic_id, cv.id1, cv.id2, cv.id3, cv.maps_to, "
92 "FROM channelview cv JOIN run_FEConfig_dat d "
93 "ON cv.logic_id = d.logic_id AND cv.name = cv.maps_to "
94 "WHERE d.iov_id = :iov_id");
95 m_readStmt->setInt(1, iovID);
96 ResultSet* rset = m_readStmt->executeQuery();
98 std::pair< EcalLogicID, RunFEConfigDat >
p;
100 while(rset->next()) {
113 terminateReadStatement();
115 throw(std::runtime_error(
"RunFEConfigDat::fetchData(): "+e.getMessage()));
oracle::occi::SQLException SQLException
void writeDB(const EcalLogicID *ecid, const RunFEConfigDat *item, RunIOV *iov)
void fetchData(std::map< EcalLogicID, RunFEConfigDat > *fillMap, RunIOV *iov)
oracle::occi::ResultSet ResultSet