10 using namespace oracle::occi;
15 m_writeStmt =
nullptr;
24 this->checkConnection();
27 m_writeStmt = m_conn->createStatement();
29 "INSERT INTO cali_general_dat (iov_id, logic_id, "
30 "num_events, comments) "
31 "VALUES (:iov_id, :logic_id, "
33 }
catch (SQLException&
e) {
34 throw(std::runtime_error(
"CaliGeneralDat::prepareWrite(): " + e.getMessage()));
39 this->checkConnection();
42 int iovID = iov->fetchID();
44 throw(std::runtime_error(
"CaliGeneralDat::writeDB: IOV not in DB"));
47 int logicID = ecid->getLogicID();
49 throw(std::runtime_error(
"CaliGeneralDat::writeDB: Bad EcalLogicID"));
53 m_writeStmt->setInt(1, iovID);
54 m_writeStmt->setInt(2, logicID);
56 m_writeStmt->setInt(3,
item->getNumEvents());
57 m_writeStmt->setString(4,
item->getComments());
59 m_writeStmt->executeUpdate();
60 }
catch (SQLException&
e) {
61 throw(std::runtime_error(
"CaliGeneralDat::writeDB(): " + e.getMessage()));
66 this->checkConnection();
69 iov->setConnection(m_env, m_conn);
70 int iovID = iov->fetchID();
78 "SELECT cv.name, cv.logic_id, cv.id1, cv.id2, cv.id3, cv.maps_to, "
79 "d.num_events, d.comments "
80 "FROM channelview cv JOIN cali_general_dat d "
81 "ON cv.logic_id = d.logic_id AND cv.name = cv.maps_to "
82 "WHERE d.iov_id = :iov_id");
83 m_readStmt->setInt(1, iovID);
84 ResultSet* rset = m_readStmt->executeQuery();
86 std::pair<EcalLogicID, CaliGeneralDat>
p;
88 while (rset->next()) {
102 }
catch (SQLException&
e) {
103 throw(std::runtime_error(
"CaliGeneralDat::fetchData(): " + e.getMessage()));
void fetchData(std::map< EcalLogicID, CaliGeneralDat > *fillVec, CaliIOV *iov) noexcept(false)
void prepareWrite() noexcept(false) override
void writeDB(const EcalLogicID *ecid, const CaliGeneralDat *item, CaliIOV *iov) noexcept(false)
void setComments(std::string comments)
~CaliGeneralDat() override
static std::vector< std::string > checklist dat