21 this->checkConnection();
24 int ecid_id = ecid.getLogicID();
27 Statement* stmt0 = m_conn->createStatement();
29 "SELECT count(since) FROM PVSS_TEMPERATURE_DAT " 30 "WHERE logic_id = :logic_id ");
31 stmt0->setInt(1, ecid_id);
33 ResultSet* rset0 = stmt0->executeQuery();
35 nruns = rset0->getInt(1);
37 m_conn->terminateStatement(stmt0);
39 cout <<
"DCSPTMTempList::fetchValuesForECID>> Number of records in DB=" << nruns << endl;
40 m_vec_temp.reserve(nruns);
42 Statement* stmt = m_conn->createStatement();
45 "since, till, temperature FROM PVSS_TEMPERATURE_DAT " 46 "WHERE logic_id = :logic_id order by since ");
47 stmt->setInt(1, ecid_id);
53 ResultSet* rset = stmt->executeQuery();
58 Date startDate = rset->getDate(1);
59 Date endDate = rset->getDate(2);
60 float x = rset->getFloat(3);
61 runStart =
dh.dateToTm(startDate);
62 runEnd =
dh.dateToTm(endDate);
68 r.setEcalLogicID(ecid);
69 m_vec_temp.push_back(
r);
74 cout <<
"DCSPTMTempList::fetchValuesForECID>> loop done " << endl;
76 m_conn->terminateStatement(stmt);
77 }
catch (SQLException&
e) {
78 throw(std::runtime_error(
"DCSPTMTempList: " +
e.getMessage()));
84 const Tm&
end) noexcept(
false) {
85 this->checkConnection();
88 int ecid_id = ecid.getLogicID();
95 Statement* stmt0 = m_conn->createStatement();
97 "SELECT count(since) FROM PVSS_TEMPERATURE_DAT " 98 "WHERE logic_id = :logic_id " 99 "AND since >= :start_time " 100 "AND since <= :till_time ");
101 stmt0->setInt(1, ecid_id);
102 stmt0->setDate(2,
dh.tmToDate(
start));
103 stmt0->setDate(3,
dh.tmToDate(
end));
105 ResultSet* rset0 = stmt0->executeQuery();
107 nruns = rset0->getInt(1);
109 m_conn->terminateStatement(stmt0);
111 cout <<
"DCSPTMTempList::fetchValuesForECIDAndTime>> Number of records in DB=" << nruns << endl;
112 m_vec_temp.reserve(nruns);
114 Statement* stmt = m_conn->createStatement();
117 "since, till, temperature FROM PVSS_TEMPERATURE_DAT " 118 "WHERE logic_id = :logic_id " 119 "AND since >= :start_time " 120 "AND since <= :till_time " 122 stmt->setInt(1, ecid_id);
123 stmt->setDate(2,
dh.tmToDate(
start));
124 stmt->setDate(3,
dh.tmToDate(
end));
126 ResultSet* rset = stmt->executeQuery();
131 Date startDate = rset->getDate(1);
132 Date endDate = rset->getDate(2);
133 float x = rset->getFloat(3);
134 runStart =
dh.dateToTm(startDate);
135 runEnd =
dh.dateToTm(endDate);
139 r.setStart(runStart);
141 r.setEcalLogicID(ecid);
142 m_vec_temp.push_back(
r);
147 m_conn->terminateStatement(stmt);
148 }
catch (SQLException&
e) {
149 throw(std::runtime_error(
"DCSPTMTempList: " +
e.getMessage()));
void fetchValuesForECID(const EcalLogicID &ecid) noexcept(false)
~DCSPTMTempList() override
std::vector< DCSPTMTemp > getList()
void fetchValuesForECIDAndTime(const EcalLogicID &ecid, const Tm &start, const Tm &end) noexcept(false)