9 using namespace oracle::occi;
31 throw(std::runtime_error)
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 ) ");
42 throw(std::runtime_error(
"RunTPGConfigDat::prepareWrite(): "+e.getMessage()));
49 throw(std::runtime_error)
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();
69 throw(std::runtime_error(
"RunTPGConfigDat::writeDB(): "+e.getMessage()));
76 throw(std::runtime_error)
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()) {
116 throw(std::runtime_error(
"RunTPGConfigDat::fetchData(): "+e.getMessage()));
void setConfigTag(std::string x)
void writeDB(const EcalLogicID *ecid, const RunTPGConfigDat *item, RunIOV *iov)
oracle::occi::SQLException SQLException
void fetchData(std::map< EcalLogicID, RunTPGConfigDat > *fillMap, RunIOV *iov)
static std::vector< std::string > checklist dat
oracle::occi::ResultSet ResultSet