13 m_writeStmt =
nullptr;
28 this->checkConnection();
31 m_writeStmt = m_conn->createStatement();
32 m_writeStmt->setSQL(
"INSERT INTO " + getTable() +
33 " (rec_id, sm_id, fed_id, tt_id, cry_id, low, mid, high) " 34 "VALUES (:1, :2, :3, :4, :5, :6, :7, :8 )");
36 throw(std::runtime_error(
"ODPedestalOffsetsDat::prepareWrite(): " +
e.getMessage()));
41 this->checkConnection();
44 m_writeStmt->setInt(1,
item->getId());
45 m_writeStmt->setInt(2,
item->getSMId());
46 m_writeStmt->setInt(3,
item->getFedId());
47 m_writeStmt->setInt(4,
item->getTTId());
48 m_writeStmt->setInt(5,
item->getCrystalId());
49 m_writeStmt->setInt(6,
item->getLow());
50 m_writeStmt->setInt(7,
item->getMid());
51 m_writeStmt->setInt(8,
item->getHigh());
53 m_writeStmt->executeUpdate();
55 throw(std::runtime_error(
"ODPedestalOffsetsDat::writeDB(): " +
e.getMessage()));
61 this->checkConnection();
63 iov->setConnection(m_env, m_conn);
64 int iovID = iov->fetchID();
71 m_readStmt->setSQL(
"SELECT * FROM " + getTable() +
" WHERE rec_id = :rec_id order by sm_id, fed_id, tt_id, cry_id");
72 m_readStmt->setInt(1, iovID);
73 ResultSet* rset = m_readStmt->executeQuery();
77 while (rset->next()) {
83 dat.
setLow(rset->getInt(6));
84 dat.
setMid(rset->getInt(7));
91 throw(std::runtime_error(
"ODPedestalOffsetsDat::fetchData(): " +
e.getMessage()));
99 this->checkConnection();
101 int iovID = iov->fetchID();
103 throw(std::runtime_error(
"ODDelays::writeArrayDB: ODFEDelaysInfo not in DB"));
106 int nrows =
data.size();
107 int* ids =
new int[nrows];
108 int*
xx =
new int[nrows];
109 int*
yy =
new int[nrows];
110 int*
zz =
new int[nrows];
111 int* st =
new int[nrows];
112 int* xx1 =
new int[nrows];
113 int* yy1 =
new int[nrows];
114 int* zz1 =
new int[nrows];
116 ub2* ids_len =
new ub2[nrows];
117 ub2* x_len =
new ub2[nrows];
118 ub2* y_len =
new ub2[nrows];
119 ub2* z_len =
new ub2[nrows];
120 ub2* st_len =
new ub2[nrows];
121 ub2* x1_len =
new ub2[nrows];
122 ub2* y1_len =
new ub2[nrows];
123 ub2* z1_len =
new ub2[nrows];
150 m_writeStmt->setDataBuffer(1, (dvoid*)ids, OCCIINT,
sizeof(ids[0]), ids_len);
151 m_writeStmt->setDataBuffer(2, (dvoid*)
xx, OCCIINT,
sizeof(
xx[0]), x_len);
152 m_writeStmt->setDataBuffer(3, (dvoid*)
yy, OCCIINT,
sizeof(
yy[0]), y_len);
153 m_writeStmt->setDataBuffer(4, (dvoid*)
zz, OCCIINT,
sizeof(
zz[0]), z_len);
154 m_writeStmt->setDataBuffer(5, (dvoid*)st, OCCIINT,
sizeof(st[0]), st_len);
155 m_writeStmt->setDataBuffer(6, (dvoid*)xx1, OCCIINT,
sizeof(xx1[0]), x1_len);
156 m_writeStmt->setDataBuffer(7, (dvoid*)yy1, OCCIINT,
sizeof(yy1[0]), y1_len);
157 m_writeStmt->setDataBuffer(8, (dvoid*)zz1, OCCIINT,
sizeof(zz1[0]), z1_len);
159 m_writeStmt->executeArrayUpdate(nrows);
180 throw(std::runtime_error(
"ODPedestalOffsetsDat::writeArrayDB(): " +
e.getMessage()));
void writeArrayDB(const std::vector< ODPedestalOffsetsDat > &data, ODFEPedestalOffsetInfo *iov) noexcept(false)
void writeDB(const ODPedestalOffsetsDat *item, ODFEPedestalOffsetInfo *iov) noexcept(false)
void fetchData(std::vector< ODPedestalOffsetsDat > *fillMap, ODFEPedestalOffsetInfo *iov) noexcept(false)
void setCrystalId(int dac)
~ODPedestalOffsetsDat() override
void prepareWrite() noexcept(false) override
char data[epos_bytes_allocation]
oracle::occi::SQLException SQLException