CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ODLaserConfig.cc
Go to the documentation of this file.
1 #include <stdexcept>
2 #include <string>
3 #include <fstream>
4 #include <iostream>
5 #include <stdio.h>
6 #include <cstdlib>
7 
9 
11 
12 using namespace std;
13 using namespace oracle::occi;
14 
16 {
17  m_env = NULL;
18  m_conn = NULL;
19  m_writeStmt = NULL;
20  m_readStmt = NULL;
21  m_size=0;
22  m_config_tag="";
23  m_ID=0;
24  clear();
25 
26 }
27 
29 
30 
31  m_debug=0;
32  m_dummy=0;
33 
34  // emtc
35  m_emtc_1=0;
36  m_emtc_2=0;
37  m_emtc_3=0;
38  m_emtc_4=0;
39  m_emtc_5=0;
40 
41  // laser
42  m_wave=0;
43  m_power=0;
44  m_switch=0;
45  m_filter=0;
46  m_on=0;
47  m_laserhost="";
48  m_laserport=0;
49 
50  // mataq
51  m_mq_base=0;
52  m_mq_none=0;
53  m_mode="" ;
54  m_chan_mask=0;
55  m_samples="";
56  m_ped_file="";
57  m_use_buffer=0;
58  m_post_trig=0;
59  m_fp_mode=0;
60  m_hal_mod_file="";
61  m_hal_add_file="";
62  m_hal_tab_file="";
63  m_serial="";
64  m_ped_count=0;
65  m_raw_mode=0;
66  m_aqmode="";
67  m_mq_file="";
68  m_laser_tag="";
69  m_matacq_vernier_min=0;
70  m_matacq_vernier_max=0;
71 
72  m_wte_2_led_delay =0;
73  m_led1_on =0;
74  m_led2_on =0;
75  m_led3_on =0;
76  m_led4_on =0;
77  m_vinj =0;
78  m_orange_led_mon_ampl=0;
79  m_blue_led_mon_ampl =0;
80  m_trig_log_file ="";
81  m_led_control_on =0;
82  m_led_control_host="";
83  m_led_control_port =0;
84  m_ir_laser_power =0;
85  m_green_laser_power=0;
86  m_red_laser_power =0;
87  m_blue_laser_log_attenuator =0;
88  m_ir_laser_log_attenuator =0;
89  m_green_laser_log_attenuator =0;
90  m_red_laser_log_attenuator =0;
91  m_laser_config_file ="";
92 
93 }
94 
96 {
97 }
98 
99 
100 
101 void ODLaserConfig::setParameters(const std::map<string,string>& my_keys_map){
102 
103  // parses the result of the XML parser that is a map of
104  // string string with variable name variable value
105 
106  for( std::map<std::string, std::string >::const_iterator ci=
107  my_keys_map.begin(); ci!=my_keys_map.end(); ci++ ) {
108 
109  if(ci->first== "LASER_CONFIGURATION_ID") setConfigTag(ci->second);
110  if(ci->first== "DEBUG") setDebug(atoi(ci->second.c_str()) );
111  if(ci->first== "LASER_DEBUG") setDebug(atoi(ci->second.c_str()) );
112  if(ci->first== "DUMMY") setDummy(atoi(ci->second.c_str() ));
113  if(ci->first== "MATACQ_BASE_ADDRESS") setMatacqBaseAddress(atoi(ci->second.c_str() ));
114  if(ci->first== "MATACQ_NONE") setMatacqNone(atoi(ci->second.c_str() ));
115  if(ci->first== "MATACQ_MODE") setMatacqMode(ci->second);
116  if(ci->first== "CHANNEL_MASK") setChannelMask(atoi(ci->second.c_str() ));
117  if(ci->first== "MAX_SAMPLES_FOR_DAQ") setMaxSamplesForDaq(ci->second );
118  if(ci->first== "MATACQ_FED_ID") setMatacqFedId(atoi(ci->second.c_str()) );
119  if(ci->first== "PEDESTAL_FILE") setPedestalFile(ci->second );
120  if(ci->first== "USE_BUFFER") setUseBuffer(atoi(ci->second.c_str())) ;
121  if(ci->first== "POSTTRIG") setPostTrig(atoi(ci->second.c_str()) );
122  if(ci->first== "FP_MODE") setFPMode(atoi(ci->second.c_str() ));
123  if(ci->first== "HAL_MODULE_FILE") setHalModuleFile(ci->second );
124  if(ci->first== "HAL_ADDRESS_TABLE_FILE" || ci->first== "HAL_ADDRESST_ABLE_FILE") setHalAddressTableFile(ci->second);
125  if(ci->first== "HAL_STATIC_TABLE_FILE") setHalStaticTableFile(ci->second );
126  if(ci->first== "MATACQ_SERIAL_NUMBER") setMatacqSerialNumber(ci->second );
127  if(ci->first== "PEDESTAL_RUN_EVENT_COUNT") setPedestalRunEventCount(atoi(ci->second.c_str()) );
128  if(ci->first== "RAW_DATA_MODE") setRawDataMode(atoi(ci->second.c_str()) );
129  if(ci->first== "ACQUISITION_MODE") setMatacqAcquisitionMode(ci->second );
130  if(ci->first== "LOCAL_OUTPUT_FILE") setLocalOutputFile(ci->second );
131  if(ci->first== "EMTC_NONE") setEMTCNone(atoi(ci->second.c_str()) );
132  if(ci->first== "WTE2_LASER_DELAY") setWTE2LaserDelay(atoi(ci->second.c_str()) );
133  if(ci->first== "LASER_PHASE") setLaserPhase(atoi(ci->second.c_str()) );
134  if(ci->first== "EMTC_TTC_IN") setEMTCTTCIn(atoi(ci->second.c_str()) );
135  if(ci->first== "EMTC_SLOT_ID") setEMTCSlotId(atoi(ci->second.c_str()) );
136  if(ci->first== "WAVELENGTH") setWaveLength(atoi(ci->second.c_str()) );
137  if(ci->first== "OPTICAL_SWITCH") setOpticalSwitch(atoi(ci->second.c_str()) );
138  if(ci->first== "POWER_SETTING") setPower(atoi(ci->second.c_str()) );
139  if(ci->first== "FILTER") setFilter(atoi(ci->second.c_str()) );
140  if(ci->first== "LASER_CONTROL_ON") setLaserControlOn(atoi(ci->second.c_str()) );
141  if(ci->first== "LASER_CONTROL_HOST") setLaserControlHost(ci->second );
142  if(ci->first== "LASER_CONTROL_PORT") setLaserControlPort(atoi(ci->second.c_str()) );
143  if(ci->first== "MATACQ_VERNIER_MAX") setMatacqVernierMax(atoi(ci->second.c_str()) );
144  if(ci->first== "MATACQ_VERNIER_MIN") setMatacqVernierMin(atoi(ci->second.c_str()) );
145 
146  if(ci->first== "WTE_2_LED_DELAY") setWTE2LedDelay(atoi(ci->second.c_str()) );
147  if(ci->first== "LED1_ON") setLed1ON(atoi(ci->second.c_str()) );
148  if(ci->first== "LED2_ON") setLed2ON(atoi(ci->second.c_str()) );
149  if(ci->first== "LED3_ON") setLed3ON(atoi(ci->second.c_str()) );
150  if(ci->first== "LED4_ON") setLed4ON(atoi(ci->second.c_str()) );
151  if(ci->first== "VINJ") setVinj(atoi(ci->second.c_str()) );
152  if(ci->first== "ORANGE_LED_MON_AMPL") setOrangeLedMonAmpl(atoi(ci->second.c_str()) );
153  if(ci->first== "BLUE_LED_MON_AMPL") setBlueLedMonAmpl(atoi(ci->second.c_str()) );
154  if(ci->first== "TRIG_LOG_FILE") setTrigLogFile(ci->second.c_str() );
155  if(ci->first== "LED_CONTROL_ON") setLedControlON(atoi(ci->second.c_str()) );
156  if(ci->first== "LED_CONTROL_HOST") setLedControlHost( ci->second.c_str() );
157  if(ci->first== "LED_CONTROL_PORT") setLedControlPort(atoi(ci->second.c_str()) );
158  if(ci->first== "IR_LASER_POWER") setIRLaserPower(atoi(ci->second.c_str()) );
159  if(ci->first== "GREEN_LASER_POWER") setGreenLaserPower(atoi(ci->second.c_str()) );
160  if(ci->first== "RED_LASER_POWER") setRedLaserPower(atoi(ci->second.c_str()) );
161  if(ci->first== "BLUE_LASER_LOG_ATTENUATOR") setBlueLaserLogAttenuator(atoi(ci->second.c_str()) );
162  if(ci->first== "IR_LASER_LOG_ATTENUATOR") setIRLaserLogAttenuator(atoi(ci->second.c_str()) );
163  if(ci->first== "GREEN_LASER_LOG_ATTENUATOR") setGreenLaserLogAttenuator(atoi(ci->second.c_str()) );
164  if(ci->first== "RED_LASER_LOG_ATTENUATOR") setRedLaserLogAttenuator(atoi(ci->second.c_str()) );
165 
166 
167  if(ci->first== "LASER_CONFIG_FILE") {
168  std::string fname=ci->second ;
169  setLaserConfigFile(fname );
170  // here we must open the file and read the DCC Clob
171  std::cout << "Going to read Laser file: " << fname << endl;
172 
173  ifstream inpFile;
174  inpFile.open(fname.c_str());
175 
176  // tell me size of file
177  int bufsize = 0;
178  inpFile.seekg( 0,ios::end );
179  bufsize = inpFile.tellg();
180  std::cout <<" bufsize ="<<bufsize<< std::endl;
181  // set file pointer to start again
182  inpFile.seekg( 0,ios::beg );
183 
184  m_size=bufsize;
185 
186  inpFile.close();
187 
188  }
189 
190 
191  }
192 
193 }
194 
195 int ODLaserConfig::fetchNextId() throw(std::runtime_error) {
196 
197  int result=0;
198  try {
199  this->checkConnection();
200 
201  m_readStmt = m_conn->createStatement();
202  m_readStmt->setSQL("select ecal_laser_config_sq.NextVal from dual");
203  ResultSet* rset = m_readStmt->executeQuery();
204  while (rset->next ()){
205  result= rset->getInt(1);
206  }
207  m_conn->terminateStatement(m_readStmt);
208  return result;
209 
210  } catch (SQLException &e) {
211  throw(std::runtime_error("ODLaserConfig::fetchNextId(): "+e.getMessage()));
212  }
213 
214 }
215 
216 
218  throw(std::runtime_error)
219 {
220  this->checkConnection();
221  int next_id=fetchNextId();
222 
223 
224  try {
225  m_writeStmt = m_conn->createStatement();
226  m_writeStmt->setSQL("INSERT INTO ECAL_Laser_CONFIGURATION ( laser_configuration_id, laser_tag "
227  ", laser_DEBUG "
228  ", DUMMY "
229  ", MATACQ_BASE_ADDRESS "
230  ", MATACQ_NONE "
231  ", matacq_mode "
232  ", channel_Mask "
233  ", max_Samples_For_Daq "
234  ", maTACQ_FED_ID "
235  ", pedestal_File "
236  ", use_Buffer "
237  ", postTrig "
238  ", fp_Mode "
239  ", hal_Module_File "
240  ", hal_Address_Table_File "
241  ", hal_Static_Table_File "
242  ", matacq_Serial_Number "
243  ", pedestal_Run_Event_Count "
244  ", raw_Data_Mode "
245  ", ACQUISITION_MODE "
246  ", LOCAL_OUTPUT_FILE "
247  ", emtc_none "
248  ", wte2_laser_delay "
249  ", laser_phase "
250  ", emtc_ttc_in "
251  ", emtc_slot_id "
252  ", WAVELENGTH "
253  ", POWER_SETTING "
254  ", OPTICAL_SWITCH "
255  ", FILTER "
256  ", LASER_CONTROL_ON "
257  ", LASER_CONTROL_HOST "
258  ", LASER_CONTROL_PORT "
259  ", LASER_TAG2 "
260  ", MATACQ_VERNIER_MIN "
261  ", MATACQ_VERNIER_MAX "
262  " , wte_2_led_delay "
263  " , led1_on "
264  " , led2_on "
265  " , led3_on "
266  " , led4_on "
267  " , VINJ "
268  " , orange_led_mon_ampl"
269  " , blue_led_mon_ampl "
270  " , trig_log_file "
271  " , led_control_on "
272  " , led_control_host "
273  " , led_control_port "
274  " , ir_laser_power "
275  " , green_laser_power"
276  " , red_laser_power "
277  " , blue_laser_log_attenuator "
278  " , IR_LASER_LOG_ATTENUATOR "
279  " , GREEN_LASER_LOG_ATTENUATOR"
280  " , RED_LASER_LOG_ATTENUATOR "
281  " , LASER_CONFIG_FILE "
282  " , laser_configuration ) "
283  " VALUES ( :1, :2, :3, :4, :5, :6, :7, :8, :9, :10, "
284  ":11, :12, :13, :14, :15, :16, :17, :18, :19, :20, "
285  ":21, :22, :23, :24, :25, :26, :27, :28, :29, :30, "
286  ":31, :32, :33, :34, :35, :36, :37, "
287  " :38, :39, :40, :41, :42, :43, :44, :45, :46, :47, :48, :49, :50, :51, :52, :53, :54, :55, :56, :57, :58 )");
288  m_writeStmt->setInt(1, next_id);
289  m_ID=next_id;
290  } catch (SQLException &e) {
291  throw(std::runtime_error("ODLaserConfig::prepareWrite(): "+e.getMessage()));
292  }
293 }
294 
295 
296 
298  throw(std::runtime_error)
299 {
300  this->checkConnection();
301  this->checkPrepare();
302 
303  try {
304 
305  // 1 is the id 2 is the tag
306  m_writeStmt->setString(2, this->getConfigTag());
307 
308  m_writeStmt->setInt( 3, this->getDebug());
309  m_writeStmt->setInt( 4, this->getDummy());
310  m_writeStmt->setInt( 5, this->getMatacqBaseAddress());
311  m_writeStmt->setInt( 6, this->getMatacqNone());
312  m_writeStmt->setString(7, this->getMatacqMode());
313  m_writeStmt->setInt( 8, this->getChannelMask());
314  m_writeStmt->setString(9, this->getMaxSamplesForDaq());
315  m_writeStmt->setInt( 10, this->getMatacqFedId());
316  m_writeStmt->setString(11, this->getPedestalFile());
317  m_writeStmt->setInt( 12, this->getUseBuffer());
318  m_writeStmt->setInt( 13, this->getPostTrig());
319  m_writeStmt->setInt( 14, this->getFPMode());
320  m_writeStmt->setString(15, this->getHalModuleFile() );
321  m_writeStmt->setString(16, this->getHalAddressTableFile() );
322  m_writeStmt->setString(17, this->getHalStaticTableFile() );
323  m_writeStmt->setString(18, this->getMatacqSerialNumber() );
324  m_writeStmt->setInt( 19, this->getPedestalRunEventCount() );
325  m_writeStmt->setInt( 20, this->getRawDataMode());
326  m_writeStmt->setString(21, this->getMatacqAcquisitionMode());
327  m_writeStmt->setString(22, this->getLocalOutputFile());
328  m_writeStmt->setInt( 23, this->getEMTCNone());
329  m_writeStmt->setInt( 24, this->getWTE2LaserDelay());
330  m_writeStmt->setInt( 25, this->getLaserPhase());
331  m_writeStmt->setInt( 26, this->getEMTCTTCIn());
332  m_writeStmt->setInt( 27, this->getEMTCSlotId());
333  // laser
334  m_writeStmt->setInt(28, this->getWaveLength());
335  m_writeStmt->setInt(29, this->getPower());
336  m_writeStmt->setInt(30, this->getOpticalSwitch());
337  m_writeStmt->setInt(31, this->getFilter());
338  m_writeStmt->setInt(32, this->getLaserControlOn());
339  m_writeStmt->setString(33, this->getLaserControlHost() );
340  m_writeStmt->setInt( 34, this->getLaserControlPort());
341  m_writeStmt->setString( 35, this->getLaserTag());
342 
343  m_writeStmt->setInt( 36, this->getMatacqVernierMin());
344  m_writeStmt->setInt( 37, this->getMatacqVernierMax());
345 
346 
347  // here goes the led and the new parameters
348  m_writeStmt->setInt( 38, this->getWTE2LedDelay());
349  m_writeStmt->setInt( 39, this->getLed1ON());
350  m_writeStmt->setInt( 40, this->getLed2ON());
351  m_writeStmt->setInt( 41, this->getLed3ON());
352  m_writeStmt->setInt( 42, this->getLed4ON());
353  m_writeStmt->setInt( 43, this->getVinj());
354  m_writeStmt->setInt( 44, this->getOrangeLedMonAmpl());
355  m_writeStmt->setInt( 45, this->getBlueLedMonAmpl());
356  m_writeStmt->setString( 46, this->getTrigLogFile());
357  m_writeStmt->setInt( 47, this->getLedControlON());
358  m_writeStmt->setString( 48, this->getLedControlHost());
359  m_writeStmt->setInt( 49, this->getLedControlPort());
360  m_writeStmt->setInt( 50, this->getIRLaserPower());
361  m_writeStmt->setInt( 51, this->getGreenLaserPower());
362  m_writeStmt->setInt( 52, this->getRedLaserPower());
363  m_writeStmt->setInt( 53, this->getBlueLaserLogAttenuator());
364  m_writeStmt->setInt( 54, this->getIRLaserLogAttenuator());
365  m_writeStmt->setInt( 55, this->getGreenLaserLogAttenuator());
366  m_writeStmt->setInt( 56, this->getRedLaserLogAttenuator());
367  m_writeStmt->setString( 57, this->getLaserConfigFile());
368 
369  // and now the clob
370  oracle::occi::Clob clob(m_conn);
371  clob.setEmpty();
372  m_writeStmt->setClob(58,clob);
373  m_writeStmt->executeUpdate ();
374  m_conn->terminateStatement(m_writeStmt);
375 
376  // now we read and update it
377  m_writeStmt = m_conn->createStatement();
378  m_writeStmt->setSQL ("SELECT laser_configuration FROM "+getTable()+" WHERE"
379  " laser_configuration_id=:1 FOR UPDATE");
380  std::cout<<"updating the laser clob "<<std::endl;
381 
382 
383  m_writeStmt->setInt(1, m_ID);
384  ResultSet* rset = m_writeStmt->executeQuery();
385  rset->next ();
386  oracle::occi::Clob clob_to_write = rset->getClob (1);
387  cout << "Opening the clob in read write mode" << endl;
388 
389  populateClob (clob_to_write, getLaserConfigFile(), m_size);
390  int clobLength=clob_to_write.length ();
391  cout << "Length of the clob is: " << clobLength << endl;
392  m_writeStmt->executeUpdate();
393  m_writeStmt->closeResultSet (rset);
394 
395 
396  } catch (SQLException &e) {
397  throw(std::runtime_error("ODLaserConfig::writeDB(): "+e.getMessage()));
398  }
399  // Now get the ID
400  if (!this->fetchID()) {
401  throw(std::runtime_error("ODLaserConfig::writeDB: Failed to write"));
402  }
403 
404 }
405 
406 
407 
409  throw(std::runtime_error)
410 {
411  this->checkConnection();
412  result->clear();
413  if(result->getId()==0 && (result->getConfigTag()=="") ){
414  throw(std::runtime_error("ODLaserConfig::fetchData(): no Id defined for this ODLaserConfig "));
415  }
416 
417  try {
418 
419  m_readStmt->setSQL("SELECT * "
420  "FROM "+getTable()+
421  " where ( laser_configuration_id = :1 or laser_tag=:2 )" );
422  m_readStmt->setInt(1, result->getId());
423  m_readStmt->setString(2, result->getConfigTag());
424  ResultSet* rset = m_readStmt->executeQuery();
425 
426  rset->next();
427 
428 
429  // start from 3 because of select *
430 
431  result->setId(rset->getInt(1));
432  result->setConfigTag(rset->getString(2));
433 
434  result->setDebug(rset->getInt( 3 ));
435  result->setDummy(rset->getInt( 4 ));
436  result->setMatacqBaseAddress(rset->getInt( 5 ));
437  result->setMatacqNone(rset->getInt( 6 ));
438  result->setMatacqMode(rset->getString(7 ));
439  result->setChannelMask(rset->getInt( 8 ));
440  result->setMaxSamplesForDaq(rset->getString( 9 ));
441  result->setMatacqFedId(rset->getInt( 10 ));
442  result->setPedestalFile(rset->getString( 11 ));
443  result->setUseBuffer(rset->getInt( 12 ));
444  result->setPostTrig(rset->getInt( 13 ));
445  result->setFPMode(rset->getInt( 14 ));
446  result->setHalModuleFile(rset->getString( 15 ));
447  result->setHalAddressTableFile(rset->getString( 16 ));
448  result->setHalStaticTableFile(rset->getString( 17 ));
449  result->setMatacqSerialNumber(rset->getString( 18 ));
450  result->setPedestalRunEventCount(rset->getInt( 19 ));
451  result->setRawDataMode(rset->getInt( 20 ));
452  result->setMatacqAcquisitionMode(rset->getString( 21 ));
453  result->setLocalOutputFile(rset->getString( 22 ));
454  result->setEMTCNone(rset->getInt( 23 ));
455  result->setWTE2LaserDelay(rset->getInt( 24 ));
456  result->setLaserPhase(rset->getInt( 25 ));
457  result->setEMTCTTCIn(rset->getInt( 26 ));
458  result->setEMTCSlotId(rset->getInt( 27 ));
459  // laser
460  result->setWaveLength(rset->getInt( 28 ));
461  result->setPower(rset->getInt( 29 ));
462  result->setOpticalSwitch(rset->getInt( 30 ));
463  result->setFilter(rset->getInt( 31 ));
464  result->setLaserControlOn(rset->getInt( 32 ));
465  result->setLaserControlHost(rset->getString( 33 ));
466  result->setLaserControlPort(rset->getInt( 34 ));
467  result->setLaserTag(rset->getString( 35 ));
468 
469  result->setMatacqVernierMin(rset->getInt( 36 ));
470  result->setMatacqVernierMax(rset->getInt( 37 ));
471 
472  result->setWTE2LedDelay(rset->getInt( 38 ));
473  result->setLed1ON(rset->getInt( 39 ));
474  result->setLed2ON(rset->getInt( 40 ));
475  result->setLed3ON(rset->getInt( 41 ));
476  result->setLed4ON(rset->getInt( 42 ));
477  result->setVinj(rset->getInt( 43 ));
478  result->setOrangeLedMonAmpl(rset->getInt( 44 ));
479  result->setBlueLedMonAmpl(rset->getInt( 45 ));
480  result->setTrigLogFile(rset->getString( 46 ));
481  result->setLedControlON(rset->getInt( 47 ));
482  result->setLedControlHost(rset->getString( 48 ));
483  result->setLedControlPort(rset->getInt( 49 ));
484  result->setIRLaserPower(rset->getInt( 50 ));
485  result->setGreenLaserPower(rset->getInt( 51 ));
486  result->setRedLaserPower(rset->getInt( 52 ));
487  result->setBlueLaserLogAttenuator(rset->getInt( 53 ));
488  result->setIRLaserLogAttenuator(rset->getInt( 54 ));
489  result->setGreenLaserLogAttenuator(rset->getInt( 55 ));
490  result->setRedLaserLogAttenuator(rset->getInt( 56 ));
491  result->setLaserConfigFile(rset->getString( 57 ));
492 
493  Clob clob = rset->getClob (58);
494  cout << "Opening the clob in Read only mode" << endl;
495  clob.open (OCCI_LOB_READONLY);
496  int clobLength=clob.length ();
497  cout << "Length of the clob is: " << clobLength << endl;
498  m_size=clobLength;
499  unsigned char* buffer = readClob (clob, m_size);
500  clob.close ();
501  cout<< "the clob buffer is:"<<endl;
502  for (int i = 0; i < clobLength; ++i)
503  cout << (char) buffer[i];
504  cout << endl;
505 
506  result->setLaserClob(buffer);
507 
508 
509  } catch (SQLException &e) {
510  throw(std::runtime_error("ODLaserConfig::fetchData(): "+e.getMessage()));
511  }
512 }
513 
514 int ODLaserConfig::fetchID() throw(std::runtime_error)
515 {
516  // Return from memory if available
517  if (m_ID!=0) {
518  return m_ID;
519  }
520 
521  this->checkConnection();
522 
523  try {
524  Statement* stmt = m_conn->createStatement();
525  stmt->setSQL("SELECT laser_configuration_id FROM ecal_laser_configuration "
526  "WHERE laser_tag=:laser_tag ");
527  stmt->setString(1, getLaserTag());
528 
529  ResultSet* rset = stmt->executeQuery();
530 
531  if (rset->next()) {
532  m_ID = rset->getInt(1);
533  } else {
534  m_ID = 0;
535  }
536  m_conn->terminateStatement(stmt);
537  } catch (SQLException &e) {
538  throw(std::runtime_error("ODLaserConfig::fetchID: "+e.getMessage()));
539  }
540 
541  fetchData(this);
542 
543  return m_ID;
544 }
int i
Definition: DBlmapReader.cc:9
#define NULL
Definition: scimark2.h:8
void setParameters(const std::map< std::string, std::string > &my_keys_map)
void clear(CLHEP::HepGenMatrix &m)
Helper function: Reset all elements of a matrix to 0.
Definition: matutil.cc:167
tuple result
Definition: query.py:137
#define end
Definition: vmac.h:37
oracle::occi::Statement Statement
Definition: IODConfig.h:23
oracle::occi::Clob Clob
Definition: IODConfig.h:25
oracle::occi::ResultSet ResultSet
Definition: HcalDbOmds.cc:26
string fname
main script
oracle::occi::SQLException SQLException
Definition: IODConfig.h:22
tuple cout
Definition: gather_cfg.py:121
void fetchData(ODLaserConfig *result)