14 m_writeStmt =
nullptr;
35 this->checkConnection();
38 m_writeStmt = m_conn->createStatement();
39 m_writeStmt->setSQL(
"INSERT INTO "+getTable()+
" (rec_id, tr_id, fed_id, tt_id, status ) " 40 "VALUES (:1, :2, :3, :4, :5 )");
42 throw(std::runtime_error(
"ODBadTTDat::prepareWrite(): "+e.getMessage()));
51 this->checkConnection();
54 m_writeStmt->setInt(1, item->getId());
55 m_writeStmt->setInt(2, item->getTRId());
56 m_writeStmt->setInt(3, item->getFedId() );
57 m_writeStmt->setInt(4, item->getTTId() );
58 m_writeStmt->setInt(5, item->getStatus() );
60 m_writeStmt->executeUpdate();
62 throw(std::runtime_error(
"ODBadTTDat::writeDB(): "+e.getMessage()));
71 this->checkConnection();
73 iov->setConnection(m_env, m_conn);
74 int iovID = iov->fetchID();
81 m_readStmt->setSQL(
"SELECT * FROM " + getTable() +
" WHERE rec_id = :rec_id order by tr_id, fed_id, tt_id ");
82 m_readStmt->setInt(1, iovID);
83 ResultSet* rset = m_readStmt->executeQuery();
98 throw(std::runtime_error(
"ODBadTTDat::fetchData(): "+e.getMessage()));
107 this->checkConnection();
109 int iovID = iov->fetchID();
110 if (!iovID) {
throw(std::runtime_error(
"ODDelays::writeArrayDB: ODBadTTInfo not in DB")); }
113 int nrows=
data.size();
114 int*
ids=
new int[nrows];
115 int*
xx=
new int[nrows];
116 int*
yy=
new int[nrows];
117 int*
zz=
new int[nrows];
118 int* st=
new int[nrows];
122 ub2* ids_len=
new ub2[nrows];
123 ub2* x_len=
new ub2[nrows];
124 ub2* y_len=
new ub2[nrows];
125 ub2* z_len=
new ub2[nrows];
126 ub2* st_len=
new ub2[nrows];
151 m_writeStmt->setDataBuffer(1, (dvoid*)ids, OCCIINT,
sizeof(ids[0]),ids_len);
152 m_writeStmt->setDataBuffer(2, (dvoid*)xx, OCCIINT ,
sizeof(xx[0]), x_len );
153 m_writeStmt->setDataBuffer(3, (dvoid*)yy, OCCIINT ,
sizeof(yy[0]), y_len );
154 m_writeStmt->setDataBuffer(4, (dvoid*)zz, OCCIINT ,
sizeof(zz[0]), z_len );
155 m_writeStmt->setDataBuffer(5, (dvoid*)st, OCCIINT ,
sizeof(st[0]), st_len );
157 m_writeStmt->executeArrayUpdate(nrows);
172 throw(std::runtime_error(
"ODBadTTDat::writeArrayDB(): "+e.getMessage()));
void writeArrayDB(const std::vector< ODBadTTDat > &data, ODBadTTInfo *iov) noexcept(false)
void fetchData(std::vector< ODBadTTDat > *fillMap, ODBadTTInfo *iov) noexcept(false)
void writeDB(const ODBadTTDat *item, ODBadTTInfo *iov) noexcept(false)
void prepareWrite() noexcept(false) override
char data[epos_bytes_allocation]
oracle::occi::SQLException SQLException