14 m_writeStmt =
nullptr;
24 this->checkConnection();
27 m_writeStmt = m_conn->createStatement();
29 "INSERT INTO run_TPGConfig_dat (iov_id, logic_id, "
30 "Config_tag , version ) "
31 "VALUES (:iov_id, :logic_id, "
32 ":Config_tag , :version ) ");
33 }
catch (SQLException&
e) {
34 throw(std::runtime_error(
"RunTPGConfigDat::prepareWrite(): " +
e.getMessage()));
39 this->checkConnection();
42 int iovID = iov->fetchID();
44 throw(std::runtime_error(
"RunTPGConfigDat::writeDB: IOV not in DB"));
47 int logicID = ecid->getLogicID();
49 throw(std::runtime_error(
"RunTPGConfigDat::writeDB: Bad EcalLogicID"));
53 m_writeStmt->setInt(1, iovID);
54 m_writeStmt->setInt(2, logicID);
55 m_writeStmt->setString(3,
item->getConfigTag());
56 m_writeStmt->setInt(4,
item->getVersion());
58 m_writeStmt->executeUpdate();
59 }
catch (SQLException&
e) {
60 throw(std::runtime_error(
"RunTPGConfigDat::writeDB(): " +
e.getMessage()));
65 this->checkConnection();
68 iov->setConnection(m_env, m_conn);
69 int iovID = iov->fetchID();
77 "SELECT cv.name, cv.logic_id, cv.id1, cv.id2, cv.id3, cv.maps_to, "
78 "d.Config_tag, d.version "
79 "FROM channelview cv JOIN run_TPGConfig_dat d "
80 "ON cv.logic_id = d.logic_id AND cv.name = cv.maps_to "
81 "WHERE d.iov_id = :iov_id");
82 m_readStmt->setInt(1, iovID);
83 ResultSet* rset = m_readStmt->executeQuery();
85 std::pair<EcalLogicID, RunTPGConfigDat>
p;
87 while (rset->next()) {
101 }
catch (SQLException&
e) {
102 throw(std::runtime_error(
"RunTPGConfigDat::fetchData(): " +
e.getMessage()));