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" 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();
50 coral::AttributeList runData;
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";
59 runtable.dataEditor().insertRow(runData);
61 std::cout <<
"database problem " << er.what() << std::endl;
62 session->transaction().rollback();
67 session->transaction().commit();
unsigned long long retrieveData(unsigned int) override
CMSRunSummaryDummy2DB(const std::string &dest)
const std::string sourceType() const override
void setAuthentication(const std::string &authPath)
const std::string dataType() const override
#define DEFINE_EDM_PLUGIN(factory, type, name)
static const std::string cmsrunsummaryTableName()
~CMSRunSummaryDummy2DB() override