14 m_writeStmt =
nullptr;
37 this->checkConnection();
40 m_writeStmt = m_conn->createStatement();
41 m_writeStmt->setSQL(
"INSERT INTO "+getTable()+
" (rec_id, fed_id, tt_id, vfe_id, GAIN, STATUS ) " 42 "VALUES (:1, :2, :3, :4, :5 , :6 )");
44 throw(std::runtime_error(
std::string(
"ODVfeToRejectDat::prepareWrite(): ")+getOraMessage(&e)));
53 this->checkConnection();
56 m_writeStmt->setInt(1, item->getId());
57 m_writeStmt->setInt(2, item->getFedId() );
58 m_writeStmt->setInt(3, item->getTTId() );
59 m_writeStmt->setInt(4, item->getVfeId() );
60 m_writeStmt->setInt(5, item->getGain() );
61 m_writeStmt->setInt(6, item->getStatus() );
63 m_writeStmt->executeUpdate();
65 throw(std::runtime_error(
std::string(
"ODVfeToRejectDat::writeDB(): ")+getOraMessage(&e)));
74 this->checkConnection();
76 iov->setConnection(m_env, m_conn);
77 int iovID = iov->fetchID();
84 m_readStmt->setSQL(
"SELECT * FROM " + getTable() +
" WHERE rec_id = :rec_id order by fed_id, tt_id, vfe_id ");
85 m_readStmt->setInt(1, iovID);
86 ResultSet* rset = m_readStmt->executeQuery();
104 throw(std::runtime_error(
std::string(
"ODVfeToRejectDat::fetchData(): ")+getOraMessage(&e)));
113 this->checkConnection();
115 int iovID = iov->fetchID();
116 if (!iovID) {
throw(std::runtime_error(
"ODDelays::writeArrayDB: ODFEDelaysInfo not in DB")); }
119 int nrows=
data.size();
120 int* ids=
new int[nrows];
121 int*
xx=
new int[nrows];
122 int*
yy=
new int[nrows];
123 int*
zz=
new int[nrows];
124 int* ww=
new int[nrows];
125 int* st=
new int[nrows];
129 ub2* ids_len=
new ub2[nrows];
130 ub2* x_len=
new ub2[nrows];
131 ub2* y_len=
new ub2[nrows];
132 ub2* z_len=
new ub2[nrows];
133 ub2* w_len=
new ub2[nrows];
134 ub2* st_len=
new ub2[nrows];
161 m_writeStmt->setDataBuffer(1, (dvoid*)ids, OCCIINT,
sizeof(ids[0]),ids_len);
162 m_writeStmt->setDataBuffer(2, (dvoid*)xx, OCCIINT ,
sizeof(xx[0]), x_len );
163 m_writeStmt->setDataBuffer(3, (dvoid*)yy, OCCIINT ,
sizeof(yy[0]), y_len );
164 m_writeStmt->setDataBuffer(4, (dvoid*)zz, OCCIINT ,
sizeof(zz[0]), z_len );
165 m_writeStmt->setDataBuffer(5, (dvoid*)ww, OCCIINT ,
sizeof(ww[0]), w_len );
166 m_writeStmt->setDataBuffer(6, (dvoid*)st, OCCIINT ,
sizeof(st[0]), st_len );
169 m_writeStmt->executeArrayUpdate(nrows);
187 throw(std::runtime_error(
std::string(
"ODVfeToRejectDat::writeArrayDB(): ")+getOraMessage(&e)));
void fetchData(std::vector< ODVfeToRejectDat > *fillMap, ODVfeToRejectInfo *iov) noexcept(false)
void writeArrayDB(const std::vector< ODVfeToRejectDat > &data, ODVfeToRejectInfo *iov) noexcept(false)
~ODVfeToRejectDat() override
void prepareWrite() noexcept(false) override
char data[epos_bytes_allocation]
oracle::occi::SQLException SQLException
void writeDB(const ODVfeToRejectDat *item, ODVfeToRejectInfo *iov) noexcept(false)