15 m_writeStmt =
nullptr;
33 this->checkConnection();
36 m_writeStmt = m_conn->createStatement();
37 m_writeStmt->setSQL(
"INSERT INTO run_TPGConfig_dat (iov_id, logic_id, " 38 "Config_tag , version ) " 39 "VALUES (:iov_id, :logic_id, " 40 ":Config_tag , :version ) ");
41 }
catch (SQLException &
e) {
42 throw(std::runtime_error(
std::string(
"RunTPGConfigDat::prepareWrite(): ")+getOraMessage(&e)));
51 this->checkConnection();
54 int iovID = iov->fetchID();
55 if (!iovID) {
throw(std::runtime_error(
"RunTPGConfigDat::writeDB: IOV not in DB")); }
57 int logicID = ecid->getLogicID();
58 if (!logicID) {
throw(std::runtime_error(
"RunTPGConfigDat::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->getVersion());
67 m_writeStmt->executeUpdate();
68 }
catch (SQLException &
e) {
69 throw(std::runtime_error(
std::string(
"RunTPGConfigDat::writeDB(): ")+getOraMessage(&e)));
78 this->checkConnection();
81 iov->setConnection(m_env, m_conn);
82 int iovID = iov->fetchID();
90 m_readStmt->setSQL(
"SELECT cv.name, cv.logic_id, cv.id1, cv.id2, cv.id3, cv.maps_to, " 91 "d.Config_tag, d.version " 92 "FROM channelview cv JOIN run_TPGConfig_dat d " 93 "ON cv.logic_id = d.logic_id AND cv.name = cv.maps_to " 94 "WHERE d.iov_id = :iov_id");
95 m_readStmt->setInt(1, iovID);
96 ResultSet* rset = m_readStmt->executeQuery();
98 std::pair< EcalLogicID, RunTPGConfigDat >
p;
100 while(rset->next()) {
106 getOraString(rset,6));
115 }
catch (SQLException &
e) {
116 throw(std::runtime_error(
std::string(
"RunTPGConfigDat::fetchData(): ")+getOraMessage(&e)));
void setConfigTag(std::string x)
~RunTPGConfigDat() override
void writeDB(const EcalLogicID *ecid, const RunTPGConfigDat *item, RunIOV *iov) noexcept(false)
void prepareWrite() noexcept(false) override
void fetchData(std::map< EcalLogicID, RunTPGConfigDat > *fillMap, RunIOV *iov) noexcept(false)