14 m_writeStmt =
nullptr;
23 this->checkConnection();
26 m_writeStmt = m_conn->createStatement();
28 "INSERT INTO run_temperature_ptm_dat (iov_id, logic_id, " 30 "VALUES (:iov_id, :logic_id, " 32 }
catch (SQLException&
e) {
33 throw(std::runtime_error(
"RunPTMTempDat::prepareWrite(): " +
e.getMessage()));
38 this->checkConnection();
41 int iovID = iov->fetchID();
43 throw(std::runtime_error(
"RunPTMTempDat::writeDB: IOV not in DB"));
46 int logicID = ecid->getLogicID();
48 throw(std::runtime_error(
"RunPTMTempDat::writeDB: Bad EcalLogicID"));
52 m_writeStmt->setInt(1, iovID);
53 m_writeStmt->setInt(2, logicID);
54 m_writeStmt->setFloat(3,
item->getTemperature());
56 m_writeStmt->executeUpdate();
57 }
catch (SQLException&
e) {
58 throw(std::runtime_error(
"RunPTMTempDat::writeDB(): " +
e.getMessage()));
63 this->checkConnection();
66 iov->setConnection(m_env, m_conn);
67 int iovID = iov->fetchID();
75 "SELECT cv.name, cv.logic_id, cv.id1, cv.id2, cv.id3, cv.maps_to, " 77 "FROM channelview cv JOIN RUN_TEMPERATURE_PTM_DAT d " 78 "ON cv.logic_id = d.logic_id AND cv.name = cv.maps_to " 79 "WHERE d.iov_id = :iov_id");
80 m_readStmt->setInt(1, iovID);
81 ResultSet* rset = m_readStmt->executeQuery();
83 std::pair<EcalLogicID, RunPTMTempDat>
p;
85 while (rset->next()) {
99 }
catch (SQLException&
e) {
100 throw(std::runtime_error(
"RunPTMTempDat::fetchData(): " +
e.getMessage()));
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)