15 m_writeStmt =
nullptr;
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, " 40 }
catch (SQLException &
e) {
41 throw(std::runtime_error(
std::string(
"RunPTMTempDat::prepareWrite(): ")+getOraMessage(&e)));
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();
65 }
catch (SQLException &
e) {
66 throw(std::runtime_error(
std::string(
"RunPTMTempDat::writeDB(): ")+getOraMessage(&e)));
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;
103 getOraString(rset,6));
111 }
catch (SQLException &
e) {
112 throw(std::runtime_error(
std::string(
"RunPTMTempDat::fetchData(): ")+getOraMessage(&e)));
void fetchData(std::map< EcalLogicID, RunPTMTempDat > *fillMap, RunIOV *iov) noexcept(false)
void prepareWrite() noexcept(false) override
~RunPTMTempDat() override
void setTemperature(float t)
void writeDB(const EcalLogicID *ecid, const RunPTMTempDat *item, RunIOV *iov) noexcept(false)