9 using namespace oracle::occi;
30 throw(std::runtime_error)
32 this->checkConnection();
35 m_writeStmt = m_conn->createStatement();
36 m_writeStmt->setSQL(
"INSERT INTO run_temperature_ptm_dat (iov_id, logic_id, "
38 "VALUES (:iov_id, :logic_id, "
41 throw(std::runtime_error(
"RunPTMTempDat::prepareWrite(): "+e.getMessage()));
48 throw(std::runtime_error)
50 this->checkConnection();
53 int iovID =
iov->fetchID();
54 if (!iovID) {
throw(std::runtime_error(
"RunPTMTempDat::writeDB: IOV not in DB")); }
56 int logicID = ecid->getLogicID();
57 if (!logicID) {
throw(std::runtime_error(
"RunPTMTempDat::writeDB: Bad EcalLogicID")); }
60 m_writeStmt->setInt(1, iovID);
61 m_writeStmt->setInt(2, logicID);
62 m_writeStmt->setFloat(3, item->getTemperature());
64 m_writeStmt->executeUpdate();
66 throw(std::runtime_error(
"RunPTMTempDat::writeDB(): "+e.getMessage()));
73 throw(std::runtime_error)
75 this->checkConnection();
78 iov->setConnection(m_env, m_conn);
79 int iovID =
iov->fetchID();
87 m_readStmt->setSQL(
"SELECT cv.name, cv.logic_id, cv.id1, cv.id2, cv.id3, cv.maps_to, "
89 "FROM channelview cv JOIN RUN_TEMPERATURE_PTM_DAT d "
90 "ON cv.logic_id = d.logic_id AND cv.name = cv.maps_to "
91 "WHERE d.iov_id = :iov_id");
92 m_readStmt->setInt(1, iovID);
93 ResultSet* rset = m_readStmt->executeQuery();
95 std::pair< EcalLogicID, RunPTMTempDat >
p;
112 throw(std::runtime_error(
"RunPTMTempDat::fetchData(): "+e.getMessage()));
void writeDB(const EcalLogicID *ecid, const RunPTMTempDat *item, RunIOV *iov)
oracle::occi::SQLException SQLException
void fetchData(std::map< EcalLogicID, RunPTMTempDat > *fillMap, RunIOV *iov)
void setTemperature(float t)
oracle::occi::ResultSet ResultSet