12 using namespace oracle::occi;
35 throw(std::runtime_error)
37 this->checkConnection();
40 m_writeStmt = m_conn->createStatement();
41 m_writeStmt->setSQL(
"INSERT INTO run_comment_dat (iov_id, "
42 "source, user_comment) "
44 ":source, :user_comment)");
46 throw(std::runtime_error(
"RunCommentDat::prepareWrite(): "+e.getMessage()));
53 throw(std::runtime_error)
55 this->checkConnection();
58 int iovID =
iov->fetchID();
59 if (!iovID) {
throw(std::runtime_error(
"RunCommentDat::writeDB: IOV not in DB")); }
62 m_writeStmt->setInt(1, iovID);
63 m_writeStmt->setString(2, item->getSource());
64 m_writeStmt->setString(3, item->getComment());
66 m_writeStmt->executeUpdate();
68 throw(std::runtime_error(
"RunCommentDat::writeDB(): "+e.getMessage()));
75 throw(std::runtime_error)
77 this->checkConnection();
82 iov->setConnection(m_env, m_conn);
83 int iovID =
iov->fetchID();
90 Statement* stmt = m_conn->createStatement();
91 stmt->setSQL(
"SELECT d.comment_id, "
92 "d.source, d.user_comment, d.db_timestamp "
93 "FROM run_comment_dat d "
94 "WHERE d.iov_id = :iov_id order by d.logic_id ");
95 stmt->setInt(1, iovID);
98 std::pair< EcalLogicID, RunCommentDat >
p;
100 while(rset->next()) {
102 rset->getInt(1), rset->getInt(1),
109 Date startDate = rset->getDate(4);
115 m_conn->terminateStatement(stmt);
117 throw(std::runtime_error(
"RunCommentDat::fetchData(): "+e.getMessage()));
oracle::occi::SQLException SQLException
oracle::occi::ResultSet ResultSet
Tm dateToTm(oracle::occi::Date &date) const