14 m_writeStmt =
nullptr;
22 this->checkConnection();
25 m_writeStmt = m_conn->createStatement();
28 "INSERT INTO run_mem_ch_errors_dat (iov_id, logic_id, " 30 "VALUES (:iov_id, :logic_id, " 31 "to_number(:error_bits))");
32 }
catch (SQLException&
e) {
33 throw(std::runtime_error(
"RunMemChErrorsDat::prepareWrite(): " +
e.getMessage()));
38 this->checkConnection();
41 int iovID = iov->fetchID();
43 throw(std::runtime_error(
"RunMemChErrorsDat::writeDB: IOV not in DB"));
46 int logicID = ecid->getLogicID();
48 throw(std::runtime_error(
"RunMemChErrorsDat::writeDB: Bad EcalLogicID"));
52 m_writeStmt->setInt(1, iovID);
53 m_writeStmt->setInt(2, logicID);
55 m_writeStmt->executeUpdate();
56 }
catch (SQLException&
e) {
57 throw(std::runtime_error(
"RunMemChErrorsDat::writeDB(): " +
e.getMessage()));
62 this->checkConnection();
65 iov->setConnection(m_env, m_conn);
66 int iovID = iov->fetchID();
75 "SELECT cv.name, cv.logic_id, cv.id1, cv.id2, cv.id3, cv.maps_to, " 76 "to_char(d.error_bits) " 77 "FROM channelview cv JOIN run_mem_ch_errors_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, RunMemChErrorsDat>
p;
85 while (rset->next()) {
99 }
catch (SQLException&
e) {
100 throw(std::runtime_error(
"RunMemChErrorsDat::fetchData(): " +
e.getMessage()));
~RunMemChErrorsDat() override
static std::string to_string(const XMLCh *ch)
void writeDB(const EcalLogicID *ecid, const RunMemChErrorsDat *item, RunIOV *iov) noexcept(false)
void setErrorBits(uint64_t bits)
void fetchData(std::map< EcalLogicID, RunMemChErrorsDat > *fillMap, RunIOV *iov) noexcept(false)
void prepareWrite() noexcept(false) override