1 #ifndef RecoLuminosity_LumiProducer_CMSRunSummaryDummy2DB_H
2 #define RecoLuminosity_LumiProducer_CMSRunSummaryDummy2DB_H
3 #include "RelationalAccess/ConnectionService.h"
4 #include "RelationalAccess/ISessionProxy.h"
5 #include "RelationalAccess/ITransaction.h"
6 #include "RelationalAccess/ITypeConverter.h"
7 #include "RelationalAccess/ISchema.h"
8 #include "RelationalAccess/ITable.h"
9 #include "RelationalAccess/ITableDataEditor.h"
10 #include "CoralBase/TimeStamp.h"
11 #include "CoralBase/AttributeList.h"
12 #include "CoralBase/AttributeSpecification.h"
13 #include "CoralBase/Attribute.h"
14 #include "CoralBase/Exception.h"
25 virtual const std::string
dataType()
const;
37 std::string fakehltkey(
"/cdaq/Cosmic/V12");
38 coral::ConnectionService*
svc=
new coral::ConnectionService;
43 coral::ISessionProxy*
session=svc->connect(
m_dest,coral::Update);
44 coral::ITypeConverter& tpc=session->typeConverter();
45 tpc.setCppTypeForSqlType(
"unsigned int",
"NUMBER(10)");
47 session->transaction().start(
false);
48 coral::ISchema&
schema=session->nominalSchema();
51 runtable.dataEditor().rowBuffer(runData);
52 runData[
"RUNNUM"].data<
unsigned int>()=runnum;
53 runData[
"FILLNUM"].data<
unsigned int>()=8973344;
54 runData[
"SEQUENCE"].data<std::string>()=
"run sequence key";
55 runData[
"HLTKEY"].data<std::string>()=fakehltkey;
59 runtable.dataEditor().insertRow(runData);
61 std::cout<<
"database problem "<<er.what()<<std::endl;
62 session->transaction().rollback();
67 session->transaction().commit();
72 return "CMSRUNSUMMARY";
virtual const std::string sourceType() const
CMSRunSummaryDummy2DB(const std::string &dest)
virtual void retrieveData(unsigned int)
void setAuthentication(const std::string &authPath)
virtual ~CMSRunSummaryDummy2DB()
virtual const std::string dataType() const
#define DEFINE_EDM_PLUGIN(factory, type, name)
static const std::string cmsrunsummaryTableName()