14 m_writeStmt =
nullptr;
24 this->checkConnection();
27 m_writeStmt = m_conn->createStatement();
29 "INSERT INTO run_config_dat (iov_id, logic_id, " 30 "config_tag, config_ver) " 31 "VALUES (:iov_id, :logic_id, " 32 ":config_tag, :config_ver)");
33 }
catch (SQLException&
e) {
34 throw(std::runtime_error(
"RunConfigDat::prepareWrite(): " + e.getMessage()));
39 this->checkConnection();
42 int iovID = iov->fetchID();
44 throw(std::runtime_error(
"RunConfigDat::writeDB: IOV not in DB"));
47 int logicID = ecid->getLogicID();
49 throw(std::runtime_error(
"RunConfigDat::writeDB: Bad EcalLogicID"));
53 m_writeStmt->setInt(1, iovID);
54 m_writeStmt->setInt(2, logicID);
55 m_writeStmt->setString(3,
item->getConfigTag());
56 m_writeStmt->setInt(4,
item->getConfigVersion());
58 m_writeStmt->executeUpdate();
59 }
catch (SQLException&
e) {
60 throw(std::runtime_error(
"RunConfigDat::writeDB(): " + e.getMessage()));
65 this->checkConnection();
68 iov->setConnection(m_env, m_conn);
69 int iovID = iov->fetchID();
77 "SELECT cv.name, cv.logic_id, cv.id1, cv.id2, cv.id3, cv.maps_to, " 78 "d.config_tag, d.config_ver " 79 "FROM channelview cv JOIN run_config_dat d " 80 "ON cv.logic_id = d.logic_id AND cv.name = cv.maps_to " 81 "WHERE d.iov_id = :iov_id");
82 m_readStmt->setInt(1, iovID);
83 ResultSet* rset = m_readStmt->executeQuery();
85 std::pair<EcalLogicID, RunConfigDat>
p;
87 while (rset->next()) {
101 }
catch (SQLException&
e) {
102 throw(std::runtime_error(
"RunConfigDat::fetchData(): " + e.getMessage()));
void setConfigVersion(int ver)
void prepareWrite() noexcept(false) override
void writeDB(const EcalLogicID *ecid, const RunConfigDat *item, RunIOV *iov) noexcept(false)
void fetchData(std::map< EcalLogicID, RunConfigDat > *fillMap, RunIOV *iov) noexcept(false)
void setConfigTag(std::string tag)