15 m_writeStmt =
nullptr;
31 this->checkConnection();
34 m_writeStmt = m_conn->createStatement();
35 m_writeStmt->setSQL(
"INSERT INTO run_laserrun_config_dat (iov_id, logic_id, " 36 "laser_sequence_type, laser_sequence_cond) " 39 }
catch (SQLException &
e) {
40 throw(std::runtime_error(
std::string(
"RunLaserRunDat::prepareWrite(): ")+getOraMessage(&e)));
49 this->checkConnection();
52 int iovID = iov->fetchID();
53 if (!iovID) {
throw(std::runtime_error(
"RunLaserRunDat::writeDB: IOV not in DB")); }
55 int logicID = ecid->getLogicID();
56 if (!logicID) {
throw(std::runtime_error(
"RunLaserRunDat::writeDB: Bad EcalLogicID")); }
59 m_writeStmt->setInt(1, iovID);
60 m_writeStmt->setInt(2, logicID);
61 m_writeStmt->setString(3, item->getLaserSequenceType());
62 m_writeStmt->setString(4, item->getLaserSequenceCond());
64 m_writeStmt->executeUpdate();
65 }
catch (SQLException &
e) {
66 throw(std::runtime_error(
std::string(
"RunLaserRunDat::writeDB(): ")+getOraMessage(&e)));
75 this->checkConnection();
78 iov->setConnection(m_env, m_conn);
79 int iovID = iov->fetchID();
86 Statement* stmt = m_conn->createStatement();
87 stmt->setSQL(
"SELECT cv.name, cv.logic_id, cv.id1, cv.id2, cv.id3, cv.maps_to, " 88 "d.laser_sequence_type, d.laser_sequence_cond " 89 "FROM channelview cv JOIN run_laserrun_config_dat d " 90 "ON cv.logic_id = d.logic_id AND cv.name = cv.maps_to " 91 "WHERE d.iov_id = :iov_id");
92 stmt->setInt(1, iovID);
93 ResultSet* rset = stmt->executeQuery();
95 std::pair< EcalLogicID, RunLaserRunDat >
p;
103 getOraString(rset,6));
111 m_conn->terminateStatement(stmt);
112 }
catch (SQLException &
e) {
113 throw(std::runtime_error(
std::string(
"RunLaserRunDat::fetchData(): ")+getOraMessage(&e)));
void prepareWrite() noexcept(false) override
void writeDB(const EcalLogicID *ecid, const RunLaserRunDat *item, RunIOV *iov) noexcept(false)
void fetchData(std::map< EcalLogicID, RunLaserRunDat > *fillMap, RunIOV *iov) noexcept(false)
void setLaserSequenceCond(std::string x)
void setLaserSequenceType(std::string x)
~RunLaserRunDat() override