19 m_writeStmt =
nullptr;
66 std::cout<<
"going to call fetchLastData"<<std::endl;
67 fetchLastData(fillMap);
68 std::cout<<
"returned from fetchLastData"<<std::endl;
78 string query=
"SELECT c.name, c.logic_id, c.id1, c.id2, c.id3, c.maps_to , v.value_number, v.change_date from "+ getMagnetAccount()+
79 ".CMSFWMAGNET_LV v, channelview c where v.dpe_name= 'CURRENT' and c.name=maps_to and c.name='EB' " ;
84 m_readStmt->setSQL(query);
85 rset = m_readStmt->executeQuery();
87 catch (SQLException
e) {
88 #if defined(_GLIBCXX_USE_CXX11_ABI) && (_GLIBCXX_USE_CXX11_ABI == 0) 89 throw(std::runtime_error(
std::string(
"RunDCSMagnetDat::getBarrelRset(): ") + getOraMessage(&e) +
" " + query));
91 throw(std::runtime_error(
std::string(
"RunDCSMagnetDat::getBarrelRset(): error code ") + std::to_string(e.getErrorCode()) +
" " + query));
100 map< EcalLogicID, RunDCSMagnetDat >* fillMap) {
104 std::pair< EcalLogicID, RunDCSMagnetDat >
p;
109 while(rset->next()) {
115 getOraString(rset,6));
117 std::cout<<
"done the logic id"<<std::endl;
119 std::cout<<
"done the magnet current"<<std::endl;
121 Date sinceDate = rset->getDate(8);
131 catch (SQLException &
e) {
132 #if defined(_GLIBCXX_USE_CXX11_ABI) && (_GLIBCXX_USE_CXX11_ABI == 0) 133 throw(std::runtime_error(
std::string(
"RunDCSMagnetDat::fetchData(): ")+getOraMessage(&e)));
135 throw(std::runtime_error(
std::string(
"RunDCSMagnetDat::fetchData(): error code ") + std::to_string(e.getErrorCode())));
147 int t_now_gmt_micros = t_now_gmt.
microsTime();
148 return t_now_gmt_micros;
156 this->checkConnection();
158 std::cout<<
"fetchLastData>>1"<<std::endl;
162 std::cout<<
"fetchLastData>>2"<<std::endl;
166 std::pair< EcalLogicID, RunDCSMagnetDat >
p;
168 std::cout<<
"fetchLastData>>3"<<std::endl;
172 std::cout<<
"fetchLastData>>4"<<std::endl;
174 fillTheMap(rset, fillMap);
175 std::cout<<
"fetchLastData>>5"<<std::endl;
179 catch (SQLException &
e) {
180 #if defined(_GLIBCXX_USE_CXX11_ABI) && (_GLIBCXX_USE_CXX11_ABI == 0) 181 throw(std::runtime_error(
std::string(
"RunDCSMagnetDat::fetchData(): ")+getOraMessage(&e)));
183 throw(std::runtime_error(
std::string(
"RunDCSMagnetDat::fetchData(): error code ") + std::to_string(e.getErrorCode())));
void fetchData(std::map< EcalLogicID, RunDCSMagnetDat > *fillMap, RunIOV *iov) noexcept(false)
void setToCurrentGMTime()
uint64_t microsTime() const
void fetchLastData(std::map< EcalLogicID, RunDCSMagnetDat > *fillMap) noexcept(false)
void setMagnetCurrent(float t)
oracle::occi::ResultSet ResultSet
void writeDB(const EcalLogicID *ecid, const RunDCSMagnetDat *item, RunIOV *iov) noexcept(false)
void fillTheMap(ResultSet *, std::map< EcalLogicID, RunDCSMagnetDat > *)
void prepareWrite() noexcept(false) override
ResultSet * getMagnetRset()
void setTime(const Tm &start)
~RunDCSMagnetDat() override
Tm dateToTm(oracle::occi::Date &date) const