14 m_writeStmt =
nullptr;
22 this->checkConnection();
25 m_writeStmt = m_conn->createStatement();
27 "INSERT INTO run_laserrun_config_dat (iov_id, logic_id, " 28 "laser_sequence_type, laser_sequence_cond) " 31 }
catch (SQLException&
e) {
32 throw(std::runtime_error(
"RunLaserRunDat::prepareWrite(): " +
e.getMessage()));
37 this->checkConnection();
40 int iovID = iov->fetchID();
42 throw(std::runtime_error(
"RunLaserRunDat::writeDB: IOV not in DB"));
45 int logicID = ecid->getLogicID();
47 throw(std::runtime_error(
"RunLaserRunDat::writeDB: Bad EcalLogicID"));
51 m_writeStmt->setInt(1, iovID);
52 m_writeStmt->setInt(2, logicID);
53 m_writeStmt->setString(3,
item->getLaserSequenceType());
54 m_writeStmt->setString(4,
item->getLaserSequenceCond());
56 m_writeStmt->executeUpdate();
57 }
catch (SQLException&
e) {
58 throw(std::runtime_error(
"RunLaserRunDat::writeDB(): " +
e.getMessage()));
63 this->checkConnection();
66 iov->setConnection(m_env, m_conn);
67 int iovID = iov->fetchID();
74 Statement* stmt = m_conn->createStatement();
76 "SELECT cv.name, cv.logic_id, cv.id1, cv.id2, cv.id3, cv.maps_to, " 77 "d.laser_sequence_type, d.laser_sequence_cond " 78 "FROM channelview cv JOIN run_laserrun_config_dat d " 79 "ON cv.logic_id = d.logic_id AND cv.name = cv.maps_to " 80 "WHERE d.iov_id = :iov_id");
81 stmt->setInt(1, iovID);
82 ResultSet* rset = stmt->executeQuery();
84 std::pair<EcalLogicID, RunLaserRunDat>
p;
86 while (rset->next()) {
100 m_conn->terminateStatement(stmt);
101 }
catch (SQLException&
e) {
102 throw(std::runtime_error(
"RunLaserRunDat::fetchData(): " +
e.getMessage()));
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