9 using namespace oracle::occi;
29 throw(std::runtime_error)
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) "
40 throw(std::runtime_error(
"RunLaserRunDat::prepareWrite(): "+e.getMessage()));
47 throw(std::runtime_error)
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();
66 throw(std::runtime_error(
"RunLaserRunDat::writeDB(): "+e.getMessage()));
73 throw(std::runtime_error)
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);
95 std::pair< EcalLogicID, RunLaserRunDat >
p;
111 m_conn->terminateStatement(stmt);
113 throw(std::runtime_error(
"RunLaserRunDat::fetchData(): "+e.getMessage()));
void fetchData(std::map< EcalLogicID, RunLaserRunDat > *fillMap, RunIOV *iov)
oracle::occi::SQLException SQLException
void setLaserSequenceCond(std::string x)
void setLaserSequenceType(std::string x)
oracle::occi::ResultSet ResultSet
void writeDB(const EcalLogicID *ecid, const RunLaserRunDat *item, RunIOV *iov)