17 m_writeStmt =
nullptr;
26 this->checkConnection();
29 m_writeStmt = m_conn->createStatement();
31 "INSERT INTO run_comment_dat (iov_id, "
32 "source, user_comment) "
34 ":source, :user_comment)");
35 }
catch (SQLException&
e) {
36 throw(std::runtime_error(
"RunCommentDat::prepareWrite(): " +
e.getMessage()));
41 this->checkConnection();
44 int iovID = iov->fetchID();
46 throw(std::runtime_error(
"RunCommentDat::writeDB: IOV not in DB"));
50 m_writeStmt->setInt(1, iovID);
51 m_writeStmt->setString(2,
item->getSource());
52 m_writeStmt->setString(3,
item->getComment());
54 m_writeStmt->executeUpdate();
55 }
catch (SQLException&
e) {
56 throw(std::runtime_error(
"RunCommentDat::writeDB(): " +
e.getMessage()));
61 this->checkConnection();
66 iov->setConnection(m_env, m_conn);
67 int iovID = iov->fetchID();
74 Statement* stmt = m_conn->createStatement();
76 "SELECT d.comment_id, "
77 "d.source, d.user_comment, d.db_timestamp "
78 "FROM run_comment_dat d "
79 "WHERE d.iov_id = :iov_id order by d.logic_id ");
80 stmt->setInt(1, iovID);
81 ResultSet* rset = stmt->executeQuery();
83 std::pair<EcalLogicID, RunCommentDat>
p;
85 while (rset->next()) {
96 Date startDate = rset->getDate(4);
97 m_time =
dh.dateToTm(startDate);
102 m_conn->terminateStatement(stmt);
103 }
catch (SQLException&
e) {
104 throw(std::runtime_error(
"RunCommentDat::fetchData(): " +
e.getMessage()));