#include <ODLTCConfig.h>
Definition at line 15 of file ODLTCConfig.h.
ODLTCConfig::ODLTCConfig |
( |
| ) |
|
Definition at line 13 of file ODLTCConfig.cc.
References NULL.
oracle::occi::Environment * m_env
oracle::occi::Connection * m_conn
ODLTCConfig::~ODLTCConfig |
( |
| ) |
|
void ODLTCConfig::clear |
( |
void |
| ) |
|
|
private |
void ODLTCConfig::fetchData |
( |
ODLTCConfig * |
result | ) |
|
throw | ( | std::runtime_error |
| ) | | |
|
private |
Definition at line 199 of file ODLTCConfig.cc.
References gather_cfg::cout, i, and query::result.
205 throw(std::runtime_error(
"ODLTCConfig::fetchData(): no Id defined for this ODLTCConfig "));
211 "FROM ECAL_LTC_CONFIGURATION "
212 " where (ltc_configuration_id = :1 or LTC_tag=:2 )" );
220 result->
setId(rset->getInt(1));
225 Clob clob = rset->getClob (4);
226 cout <<
"Opening the clob in Read only mode" << endl;
227 clob.open (OCCI_LOB_READONLY);
228 int clobLength=clob.length ();
229 cout <<
"Length of the clob is: " << clobLength << endl;
231 unsigned char* buffer =
readClob (clob, clobLength);
233 cout<<
"the clob buffer is:"<<endl;
234 for (
int i = 0;
i < clobLength; ++
i)
235 cout << (
char) buffer[
i];
242 throw(std::runtime_error(
"ODLTCConfig::fetchData(): "+e.getMessage()));
unsigned char * readClob(Clob &clob, int size)
void setLTCConfigurationFile(std::string x)
oracle::occi::SQLException SQLException
void setLTCClob(unsigned char *x)
oracle::occi::ResultSet ResultSet
void setConfigTag(std::string x)
std::string getConfigTag()
void checkConnection() const
int ODLTCConfig::fetchID |
( |
| ) |
|
throw | ( | std::runtime_error |
| ) | | |
|
private |
Definition at line 248 of file ODLTCConfig.cc.
258 stmt->setSQL(
"SELECT ltc_configuration_id FROM ecal_ltc_configuration "
259 "WHERE ltc_tag=:ltc_tag "
267 m_ID = rset->getInt(1);
271 m_conn->terminateStatement(stmt);
273 throw(std::runtime_error(
"ODLTCConfig::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 ODLTCConfig::fetchNextId |
( |
| ) |
|
throw | ( | std::runtime_error |
| ) | | |
|
private |
Definition at line 34 of file ODLTCConfig.cc.
References query::result.
41 m_readStmt->setSQL(
"select ecal_ltc_config_sq.NextVal from dual");
43 while (rset->next ()){
44 result= rset->getInt(1);
50 throw(std::runtime_error(
"ODLTCConfig::fetchNextId(): "+e.getMessage()));
oracle::occi::Connection * m_conn
oracle::occi::SQLException SQLException
oracle::occi::ResultSet ResultSet
void checkConnection() const
int ODLTCConfig::getId |
( |
| ) |
const |
|
inline |
unsigned char* ODLTCConfig::getLTCClob |
( |
| ) |
const |
|
inline |
std::string ODLTCConfig::getLTCConfigurationFile |
( |
| ) |
const |
|
inline |
unsigned int ODLTCConfig::getSize |
( |
| ) |
const |
|
inline |
std::string ODLTCConfig::getTable |
( |
| ) |
|
|
inlinevirtual |
void ODLTCConfig::prepareWrite |
( |
| ) |
|
throw | ( | std::runtime_error |
| ) | | |
|
privatevirtual |
Implements IODConfig.
Definition at line 58 of file ODLTCConfig.cc.
References gather_cfg::cout.
67 m_writeStmt->setSQL(
"INSERT INTO ECAL_LTC_CONFIGURATION (ltc_configuration_id, ltc_tag, "
68 " LTC_CONFIGURATION_file, "
70 "VALUES (:1, :2, :3, :4 )");
77 oracle::occi::Clob clob(
m_conn);
84 std::cout<<
"LTC Clob inserted into CONFIGURATION with id="<<next_id<<std::endl;
88 m_writeStmt->setSQL (
"SELECT Configuration FROM ECAL_LTC_CONFIGURATION WHERE"
89 " ltc_configuration_id=:1 FOR UPDATE");
91 std::cout<<
"updating the clob 0"<<std::endl;
95 throw(std::runtime_error(
"ODLTCConfig::prepareWrite(): "+e.getMessage()));
98 std::cout<<
"updating the clob 1 "<<std::endl;
oracle::occi::Connection * m_conn
oracle::occi::SQLException SQLException
std::string getLTCConfigurationFile() const
std::string getConfigTag()
void checkConnection() const
void ODLTCConfig::setId |
( |
int |
id | ) |
|
|
inline |
void ODLTCConfig::setLTCClob |
( |
unsigned char * |
x | ) |
|
|
inline |
void ODLTCConfig::setLTCConfigurationFile |
( |
std::string |
x | ) |
|
|
inline |
void ODLTCConfig::setParameters |
( |
std::map< std::string, std::string > |
my_keys_map | ) |
|
Definition at line 102 of file ODLTCConfig.cc.
References gather_cfg::cout, end, alignmentValidation::fname, and pos.
107 for( std::map<std::string, std::string >::iterator ci=
108 my_keys_map.begin(); ci!=my_keys_map.end(); ci++ ) {
110 if(ci->first==
"LTC_CONFIGURATION_ID")
setConfigTag(ci->second);
111 if(ci->first==
"Configuration") {
112 std::string
fname=ci->second ;
116 pos = fname.find(
"=");
118 str3 = fname.substr (pos+1, pose-pos-2);
120 cout <<
"fname="<<fname<<
" and reduced is: "<<str3 << endl;
125 std::cout <<
"Going to read LTC file: " << fname << endl;
128 inpFile.open(str3.c_str());
133 bufsize = inpFile.tellg();
134 std::cout <<
" bufsize ="<<bufsize<< std::endl;
136 inpFile.seekg( 0,ios::beg );
void setLTCConfigurationFile(std::string x)
void setConfigTag(std::string x)
void ODLTCConfig::setSize |
( |
unsigned int |
id | ) |
|
|
inline |
void ODLTCConfig::writeDB |
( |
| ) |
|
throw | ( | std::runtime_error |
| ) | | |
|
private |
Definition at line 148 of file ODLTCConfig.cc.
References gather_cfg::cout.
152 std::cout<<
"updating the clob "<<std::endl;
163 oracle::occi::Clob clob = rset->getClob (1);
165 cout <<
"Opening the clob in read write mode" << endl;
167 std::cout <<
"Populating the clob" << endl;
170 int clobLength=clob.length ();
171 cout <<
"Length of the clob is: " << clobLength << endl;
179 throw(std::runtime_error(
"ODLTCConfig::writeDB(): "+e.getMessage()));
183 throw(std::runtime_error(
"ODLTCConfig::writeDB: Failed to write"));
void populateClob(Clob &clob, std::string fname, unsigned int bufsize)
oracle::occi::SQLException SQLException
std::string getLTCConfigurationFile() const
oracle::occi::ResultSet ResultSet
unsigned char* ODLTCConfig::m_ltc_clob |
|
private |
std::string ODLTCConfig::m_ltc_file |
|
private |