13 m_writeStmt =
nullptr;
27 this->checkConnection();
30 m_writeStmt = m_conn->createStatement();
31 m_writeStmt->setSQL(
"INSERT INTO " + getTable() +
32 " (rec_id, fed_id, tt_id, gol_id, gol_current, pll_current, status ) " 33 "VALUES (:1, :2, :3, :4, :5 , :6, :7)");
35 throw(std::runtime_error(
"ODGolBiasCurrentDat::prepareWrite(): " +
e.getMessage()));
40 this->checkConnection();
43 m_writeStmt->setInt(1,
item->getId());
44 m_writeStmt->setInt(2,
item->getFedId());
45 m_writeStmt->setInt(3,
item->getTTId());
46 m_writeStmt->setInt(4,
item->getGolId());
47 m_writeStmt->setInt(5,
item->getCurrent());
48 m_writeStmt->setInt(6,
item->getPLLCurrent());
49 m_writeStmt->setInt(7,
item->getStatus());
51 m_writeStmt->executeUpdate();
53 throw(std::runtime_error(
"ODGolBiasCurrentDat::writeDB(): " +
e.getMessage()));
58 this->checkConnection();
60 iov->setConnection(m_env, m_conn);
61 int iovID = iov->fetchID();
68 m_readStmt->setSQL(
"SELECT * FROM " + getTable() +
" WHERE rec_id = :rec_id order by fed_id, tt_id, gol_id ");
69 m_readStmt->setInt(1, iovID);
70 ResultSet* rset = m_readStmt->executeQuery();
74 while (rset->next()) {
87 throw(std::runtime_error(
"ODGolBiasCurrentDat::fetchData(): " +
e.getMessage()));
95 this->checkConnection();
97 int iovID = iov->fetchID();
99 throw(std::runtime_error(
"ODDelays::writeArrayDB: ODFEDelaysInfo not in DB"));
102 int nrows =
data.size();
103 int* ids =
new int[nrows];
104 int*
xx =
new int[nrows];
105 int*
yy =
new int[nrows];
106 int*
zz =
new int[nrows];
107 int*
ww =
new int[nrows];
108 int*
kk =
new int[nrows];
109 int* st =
new int[nrows];
111 ub2* ids_len =
new ub2[nrows];
112 ub2* x_len =
new ub2[nrows];
113 ub2* y_len =
new ub2[nrows];
114 ub2* z_len =
new ub2[nrows];
115 ub2* w_len =
new ub2[nrows];
116 ub2* k_len =
new ub2[nrows];
117 ub2* st_len =
new ub2[nrows];
141 m_writeStmt->setDataBuffer(1, (dvoid*)ids, OCCIINT,
sizeof(ids[0]), ids_len);
142 m_writeStmt->setDataBuffer(2, (dvoid*)
xx, OCCIINT,
sizeof(
xx[0]), x_len);
143 m_writeStmt->setDataBuffer(3, (dvoid*)
yy, OCCIINT,
sizeof(
yy[0]), y_len);
144 m_writeStmt->setDataBuffer(4, (dvoid*)
zz, OCCIINT,
sizeof(
zz[0]), z_len);
145 m_writeStmt->setDataBuffer(5, (dvoid*)
ww, OCCIINT,
sizeof(
ww[0]), w_len);
146 m_writeStmt->setDataBuffer(6, (dvoid*)
kk, OCCIINT,
sizeof(
kk[0]), k_len);
147 m_writeStmt->setDataBuffer(7, (dvoid*)st, OCCIINT,
sizeof(st[0]), st_len);
149 m_writeStmt->executeArrayUpdate(nrows);
168 throw(std::runtime_error(
"ODGolBiasCurrentDat::writeArrayDB(): " +
e.getMessage()));
int getPLLCurrent() const
void setPLLCurrent(int x)
void fetchData(std::vector< ODGolBiasCurrentDat > *fillMap, ODGolBiasCurrentInfo *iov) noexcept(false)
void writeDB(const ODGolBiasCurrentDat *item, ODGolBiasCurrentInfo *iov) noexcept(false)
void prepareWrite() noexcept(false) override
~ODGolBiasCurrentDat() override
char data[epos_bytes_allocation]
oracle::occi::SQLException SQLException
void writeArrayDB(const std::vector< ODGolBiasCurrentDat > &data, ODGolBiasCurrentInfo *iov) noexcept(false)