14 m_writeStmt =
nullptr;
23 this->checkConnection();
26 m_writeStmt = m_conn->createStatement();
29 "INSERT INTO run_mem_tt_errors_dat (iov_id, logic_id, " 31 "VALUES (:iov_id, :logic_id, " 32 "to_number(:error_bits))");
33 }
catch (SQLException&
e) {
34 throw(std::runtime_error(
"RunMemTTErrorsDat::prepareWrite(): " +
e.getMessage()));
39 this->checkConnection();
42 int iovID = iov->fetchID();
44 throw(std::runtime_error(
"RunMemTTErrorsDat::writeDB: IOV not in DB"));
47 int logicID = ecid->getLogicID();
49 throw(std::runtime_error(
"RunMemTTErrorsDat::writeDB: Bad EcalLogicID"));
53 m_writeStmt->setInt(1, iovID);
54 m_writeStmt->setInt(2, logicID);
56 m_writeStmt->executeUpdate();
57 }
catch (SQLException&
e) {
58 throw(std::runtime_error(
"RunMemTTErrorsDat::writeDB(): " +
e.getMessage()));
63 this->checkConnection();
66 iov->setConnection(m_env, m_conn);
67 int iovID = iov->fetchID();
76 "SELECT cv.name, cv.logic_id, cv.id1, cv.id2, cv.id3, cv.maps_to, " 77 "to_char(d.error_bits) " 78 "FROM channelview cv JOIN run_mem_tt_errors_dat d " 79 "ON cv.logic_id = d.logic_id AND cv.name = cv.maps_to " 80 "WHERE d.iov_id = :iov_id");
81 m_readStmt->setInt(1, iovID);
82 ResultSet* rset = m_readStmt->executeQuery();
84 std::pair<EcalLogicID, RunMemTTErrorsDat>
p;
86 while (rset->next()) {
100 }
catch (SQLException&
e) {
101 throw(std::runtime_error(
"RunMemTTErrorsDat::fetchData(): " +
e.getMessage()));
void writeDB(const EcalLogicID *ecid, const RunMemTTErrorsDat *item, RunIOV *iov) noexcept(false)
static std::string to_string(const XMLCh *ch)
void prepareWrite() noexcept(false) override
void fetchData(std::map< EcalLogicID, RunMemTTErrorsDat > *fillMap, RunIOV *iov) noexcept(false)
void setErrorBits(uint64_t bits)
~RunMemTTErrorsDat() override