14 m_writeStmt =
nullptr;
21 this->checkConnection();
24 m_writeStmt = m_conn->createStatement();
26 "INSERT INTO run_dat (iov_id, logic_id, " 28 "VALUES (:iov_id, :logic_id, " 30 }
catch (SQLException&
e) {
31 throw(std::runtime_error(
"RunDat::prepareWrite(): " +
e.getMessage()));
36 this->checkConnection();
39 int iovID = iov->fetchID();
41 throw(std::runtime_error(
"RunDat::writeDB: IOV not in DB"));
44 int logicID = ecid->getLogicID();
46 throw(std::runtime_error(
"RunDat::writeDB: Bad EcalLogicID"));
50 m_writeStmt->setInt(1, iovID);
51 m_writeStmt->setInt(2, logicID);
52 m_writeStmt->setInt(3,
item->getNumEvents());
54 m_writeStmt->executeUpdate();
55 }
catch (SQLException&
e) {
56 throw(std::runtime_error(
"RunDat::writeDB(): " +
e.getMessage()));
61 this->checkConnection();
64 iov->setConnection(m_env, m_conn);
65 int iovID = iov->fetchID();
72 Statement* stmt = m_conn->createStatement();
74 "SELECT cv.name, cv.logic_id, cv.id1, cv.id2, cv.id3, cv.maps_to, " 76 "FROM channelview cv JOIN run_dat d " 77 "ON cv.logic_id = d.logic_id AND cv.name = cv.maps_to " 78 "WHERE d.iov_id = :iov_id");
79 stmt->setInt(1, iovID);
80 ResultSet* rset = stmt->executeQuery();
82 std::pair<EcalLogicID, RunDat>
p;
84 while (rset->next()) {
97 m_conn->terminateStatement(stmt);
98 }
catch (SQLException&
e) {
99 throw(std::runtime_error(
"RunDat::fetchData(): " +
e.getMessage()));
void fetchData(std::map< EcalLogicID, RunDat > *fillMap, RunIOV *iov) noexcept(false)
void setNumEvents(int num)
void writeDB(const EcalLogicID *ecid, const RunDat *item, RunIOV *iov) noexcept(false)
void prepareWrite() noexcept(false) override