33 this->checkConnection();
36 m_writeStmt = m_conn->createStatement();
37 m_writeStmt->setSQL(
"INSERT INTO run_config_dat (iov_id, logic_id, " 38 "config_tag, config_ver) " 39 "VALUES (:iov_id, :logic_id, " 40 ":config_tag, :config_ver)");
41 }
catch (SQLException &
e) {
42 throw(std::runtime_error(
"RunConfigDat::prepareWrite(): "+e.getMessage()));
51 this->checkConnection();
54 int iovID = iov->fetchID();
55 if (!iovID) {
throw(std::runtime_error(
"RunConfigDat::writeDB: IOV not in DB")); }
57 int logicID = ecid->getLogicID();
58 if (!logicID) {
throw(std::runtime_error(
"RunConfigDat::writeDB: Bad EcalLogicID")); }
61 m_writeStmt->setInt(1, iovID);
62 m_writeStmt->setInt(2, logicID);
63 m_writeStmt->setString(3, item->getConfigTag());
64 m_writeStmt->setInt(4, item->getConfigVersion());
66 m_writeStmt->executeUpdate();
67 }
catch (SQLException &
e) {
68 throw(std::runtime_error(
"RunConfigDat::writeDB(): "+e.getMessage()));
77 this->checkConnection();
80 iov->setConnection(m_env, m_conn);
81 int iovID = iov->fetchID();
89 m_readStmt->setSQL(
"SELECT cv.name, cv.logic_id, cv.id1, cv.id2, cv.id3, cv.maps_to, " 90 "d.config_tag, d.config_ver " 91 "FROM channelview cv JOIN run_config_dat d " 92 "ON cv.logic_id = d.logic_id AND cv.name = cv.maps_to " 93 "WHERE d.iov_id = :iov_id");
94 m_readStmt->setInt(1, iovID);
95 ResultSet* rset = m_readStmt->executeQuery();
97 std::pair< EcalLogicID, RunConfigDat >
p;
113 }
catch (SQLException &
e) {
114 throw(std::runtime_error(
"RunConfigDat::fetchData(): "+e.getMessage()));
void prepareWrite() noexcept(false)
void setConfigVersion(int ver)
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)