10 using namespace oracle::occi;
32 throw(std::runtime_error)
34 this->checkConnection();
37 m_writeStmt = m_conn->createStatement();
38 m_writeStmt->setSQL(
"INSERT INTO cali_hv_scan_ratio_dat (iov_id, logic_id, "
39 "hvratio, hvratio_rms, task_status) "
40 "VALUES (:iov_id, :logic_id, "
43 throw(std::runtime_error(
"CaliHVScanRatioDat::prepareWrite(): "+e.getMessage()));
50 throw(std::runtime_error)
52 this->checkConnection();
55 int iovID =
iov->fetchID();
56 if (!iovID) {
throw(std::runtime_error(
"CaliHVScanRatioDat::writeDB: IOV not in DB")); }
58 int logicID = ecid->getLogicID();
59 if (!logicID) {
throw(std::runtime_error(
"CaliHVScanRatioDat::writeDB: Bad EcalLogicID")); }
62 m_writeStmt->setInt(1, iovID);
63 m_writeStmt->setInt(2, logicID);
65 m_writeStmt->setFloat(3, item->getHVRatio() );
66 m_writeStmt->setFloat(4, item->getHVRatioRMS() );
67 m_writeStmt->setInt(5, item->getTaskStatus() );
69 m_writeStmt->executeUpdate();
71 throw(std::runtime_error(
"CaliHVScanRatioDat::writeDB(): "+e.getMessage()));
78 throw(std::runtime_error)
80 this->checkConnection();
83 iov->setConnection(m_env, m_conn);
84 int iovID =
iov->fetchID();
91 Statement* stmt = m_conn->createStatement();
92 stmt->setSQL(
"SELECT cv.name, cv.logic_id, cv.id1, cv.id2, cv.id3, cv.maps_to, "
93 "d.hvratio, d.hvratio_rms, d.task_status "
94 "FROM channelview cv JOIN cali_hv_scan_ratio_dat d "
95 "ON cv.logic_id = d.logic_id AND cv.name = cv.maps_to "
96 "WHERE d.iov_id = :iov_id");
97 stmt->setInt(1, iovID);
100 std::pair< EcalLogicID, CaliHVScanRatioDat >
p;
102 while(rset->next()) {
118 throw(std::runtime_error(
"CaliHVScanRatioDat::fetchData(): "+e.getMessage()));
void writeDB(const EcalLogicID *ecid, const CaliHVScanRatioDat *item, CaliIOV *iov)
void setTaskStatus(bool s)
oracle::occi::SQLException SQLException
static std::vector< std::string > checklist dat
oracle::occi::ResultSet ResultSet
void setHVRatioRMS(float c)
void fetchData(std::map< EcalLogicID, CaliHVScanRatioDat > *fillVec, CaliIOV *iov)