#include <ODTTCciConfig.h>
Definition at line 15 of file ODTTCciConfig.h.
ODTTCciConfig::ODTTCciConfig |
( |
| ) |
|
Definition at line 15 of file ODTTCciConfig.cc.
References hitfit::clear(), and NULL.
oracle::occi::Environment * m_env
oracle::occi::Connection * m_conn
std::string m_configuration_script
std::string m_configuration_script_params
ODTTCciConfig::~ODTTCciConfig |
( |
| ) |
|
void ODTTCciConfig::clear |
( |
void |
| ) |
|
|
private |
void ODTTCciConfig::fetchData |
( |
ODTTCciConfig * |
result | ) |
|
throw | ( | std::runtime_error |
| ) | | |
|
private |
Definition at line 207 of file ODTTCciConfig.cc.
References gather_cfg::cout, alignCSCRings::e, i, and query::result.
213 throw(std::runtime_error(
"ODTTCciConfig::fetchData(): no Id defined for this ODTTCciConfig "));
219 "FROM ECAL_TTCci_CONFIGURATION "
220 " where ( ttcci_configuration_id = :1 or ttcci_tag=:2 )" );
228 result->
setId(rset->getInt(1));
239 Clob clob = rset->getClob (6);
240 cout <<
"Opening the clob in Read only mode" << endl;
241 clob.open (OCCI_LOB_READONLY);
242 int clobLength=clob.length ();
243 cout <<
"Length of the clob is: " << clobLength << endl;
247 cout<<
"the clob buffer is:"<<endl;
248 for (
int i = 0;
i < clobLength; ++
i)
249 cout << (
char) buffer[
i];
256 throw(std::runtime_error(
"ODTTCciConfig::fetchData(): "+e.getMessage()));
void setConfigurationScript(std::string x)
void setTTCciClob(unsigned char *x)
unsigned char * readClob(Clob &clob, int size)
oracle::occi::SQLException SQLException
void setTTCciConfigurationFile(std::string x)
void setTrgMode(std::string x)
void setConfigurationScriptParams(std::string x)
oracle::occi::ResultSet ResultSet
void setConfigTag(std::string x)
std::string getConfigTag()
void checkConnection() const
int ODTTCciConfig::fetchID |
( |
| ) |
|
throw | ( | std::runtime_error |
| ) | | |
|
private |
Definition at line 262 of file ODTTCciConfig.cc.
References alignCSCRings::e.
272 stmt->setSQL(
"SELECT ttcci_configuration_id FROM ecal_ttcci_configuration "
273 "WHERE ttcci_tag=:ttcci_tag "
281 m_ID = rset->getInt(1);
285 m_conn->terminateStatement(stmt);
287 throw(std::runtime_error(
"ODTTCciConfig::fetchID: "+e.getMessage()));
oracle::occi::Connection * m_conn
oracle::occi::SQLException SQLException
oracle::occi::Statement Statement
oracle::occi::ResultSet ResultSet
std::string getConfigTag()
void checkConnection() const
int ODTTCciConfig::fetchNextId |
( |
| ) |
|
throw | ( | std::runtime_error |
| ) | | |
|
private |
Definition at line 43 of file ODTTCciConfig.cc.
References alignCSCRings::e, and query::result.
50 m_readStmt->setSQL(
"select ecal_ttcci_config_sq.NextVal from dual");
52 while (rset->next ()){
53 result= rset->getInt(1);
59 throw(std::runtime_error(
"ODTTCciConfig::fetchNextId(): "+e.getMessage()));
oracle::occi::Connection * m_conn
oracle::occi::SQLException SQLException
oracle::occi::ResultSet ResultSet
void checkConnection() const
std::string ODTTCciConfig::getConfigurationScript |
( |
| ) |
const |
|
inline |
std::string ODTTCciConfig::getConfigurationScriptParams |
( |
| ) |
const |
|
inline |
int ODTTCciConfig::getId |
( |
| ) |
const |
|
inline |
unsigned int ODTTCciConfig::getSize |
( |
| ) |
const |
|
inline |
std::string ODTTCciConfig::getTable |
( |
| ) |
|
|
inlinevirtual |
std::string ODTTCciConfig::getTrgMode |
( |
| ) |
const |
|
inline |
int ODTTCciConfig::getTrgSleep |
( |
| ) |
const |
|
inline |
unsigned char* ODTTCciConfig::getTTCciClob |
( |
| ) |
const |
|
inline |
std::string ODTTCciConfig::getTTCciConfigurationFile |
( |
| ) |
const |
|
inline |
void ODTTCciConfig::prepareWrite |
( |
| ) |
|
throw | ( | std::runtime_error |
| ) | | |
|
privatevirtual |
Implements IODConfig.
Definition at line 67 of file ODTTCciConfig.cc.
References gather_cfg::cout, and alignCSCRings::e.
76 m_writeStmt->setSQL(
"INSERT INTO ECAL_TTCci_CONFIGURATION (ttcci_configuration_id, ttcci_tag, "
77 " TTCCI_configuration_file, TRG_MODE, TRG_SLEEP, Configuration, configuration_script, configuration_script_params ) "
78 "VALUES (:1, :2, :3, :4, :5, :6, :7, :8 )");
88 oracle::occi::Clob clob(
m_conn);
95 std::cout<<
"TTCci Clob inserted into CONFIGURATION with id="<<next_id<<std::endl;
99 m_writeStmt->setSQL (
"SELECT Configuration FROM ECAL_TTCci_CONFIGURATION WHERE"
100 " ttcci_configuration_id=:1 FOR UPDATE");
102 std::cout<<
"updating the clob 0"<<std::endl;
106 throw(std::runtime_error(
"ODTTCciConfig::prepareWrite(): "+e.getMessage()));
109 std::cout<<
"updating the clob 1 "<<std::endl;
oracle::occi::Connection * m_conn
std::string getConfigurationScript() const
oracle::occi::SQLException SQLException
std::string getTTCciConfigurationFile() const
std::string getConfigurationScriptParams() const
std::string getConfigTag()
void checkConnection() const
std::string getTrgMode() const
void ODTTCciConfig::setConfigurationScript |
( |
std::string |
x | ) |
|
|
inline |
void ODTTCciConfig::setConfigurationScriptParams |
( |
std::string |
x | ) |
|
|
inline |
void ODTTCciConfig::setId |
( |
int |
id | ) |
|
|
inline |
void ODTTCciConfig::setParameters |
( |
std::map< std::string, std::string > |
my_keys_map | ) |
|
Definition at line 113 of file ODTTCciConfig.cc.
References gather_cfg::cout, end, alignmentValidation::fname, pos, and AlCaHLTBitMon_QueryRunRegistry::string.
118 for( std::map<std::string, std::string >::iterator ci=
119 my_keys_map.begin(); ci!=my_keys_map.end(); ci++ ) {
121 if(ci->first==
"TRG_MODE")
setTrgMode(ci->second);
122 if(ci->first==
"TRG_SLEEP")
setTrgSleep(atoi(ci->second.c_str()));
123 if(ci->first==
"TTCci_CONFIGURATION_ID")
setConfigTag(ci->second);
127 if(ci->first==
"Configuration") {
132 pos = fname.find(
"=");
134 str3 = fname.substr (pos+1, pose-pos-2);
136 cout <<
"fname="<<fname<<
" and reduced is: "<<str3 << endl;
141 std::cout <<
"Going to read file: " << str3 << endl;
144 inpFile.open(str3.c_str());
149 bufsize = inpFile.tellg();
150 std::cout <<
" bufsize ="<<bufsize<< std::endl;
152 inpFile.seekg( 0,ios::beg );
void setConfigurationScript(std::string x)
void setTTCciConfigurationFile(std::string x)
void setTrgMode(std::string x)
void setConfigurationScriptParams(std::string x)
void setConfigTag(std::string x)
void ODTTCciConfig::setSize |
( |
unsigned int |
id | ) |
|
|
inline |
void ODTTCciConfig::setTrgMode |
( |
std::string |
x | ) |
|
|
inline |
void ODTTCciConfig::setTrgSleep |
( |
int |
id | ) |
|
|
inline |
void ODTTCciConfig::setTTCciClob |
( |
unsigned char * |
x | ) |
|
|
inline |
void ODTTCciConfig::setTTCciConfigurationFile |
( |
std::string |
x | ) |
|
|
inline |
void ODTTCciConfig::writeDB |
( |
| ) |
|
throw | ( | std::runtime_error |
| ) | | |
|
private |
Definition at line 163 of file ODTTCciConfig.cc.
References gather_cfg::cout, and alignCSCRings::e.
168 std::cout<<
"updating the clob 2"<<std::endl;
177 while (rset->next ())
179 oracle::occi::Clob clob = rset->getClob (1);
180 cout <<
"Opening the clob in read write mode" << endl;
181 cout <<
"Populating the clob" << endl;
183 int clobLength=clob.length ();
184 cout <<
"Length of the clob is: " << clobLength << endl;
193 throw(std::runtime_error(
"ODTTCciConfig::writeDB(): "+e.getMessage()));
197 throw(std::runtime_error(
"ODTTCciConfig::writeDB: Failed to write"));
void populateClob(Clob &clob, std::string fname, unsigned int bufsize)
oracle::occi::SQLException SQLException
std::string getTTCciConfigurationFile() const
oracle::occi::ResultSet ResultSet
std::string ODTTCciConfig::m_configuration_script |
|
private |
std::string ODTTCciConfig::m_configuration_script_params |
|
private |
int ODTTCciConfig::m_size |
|
private |
std::string ODTTCciConfig::m_trg_mode |
|
private |
int ODTTCciConfig::m_trg_sleep |
|
private |
unsigned char* ODTTCciConfig::m_ttcci_clob |
|
private |
std::string ODTTCciConfig::m_ttcci_file |
|
private |