35 if (ver != m_monVer) {
57 this->checkConnection();
60 Statement* stmt = m_conn->createStatement();
61 stmt->setSQL(
"SELECT def_id FROM mon_version_def WHERE " 64 stmt->setString(1, m_monVer);
66 ResultSet* rset = stmt->executeQuery();
69 m_ID = rset->getInt(1);
73 m_conn->terminateStatement(stmt);
74 }
catch (SQLException &
e) {
75 throw(std::runtime_error(
std::string(
"MonVersionDef::fetchID: ")+e.getMessage()));
86 this->checkConnection();
89 Statement* stmt = m_conn->createStatement();
91 stmt->setSQL(
"SELECT mon_ver, description FROM mon_version_def WHERE def_id = :1");
94 ResultSet* rset = stmt->executeQuery();
96 m_monVer = rset->getString(1);
97 m_desc = rset->getString(2);
99 throw(std::runtime_error(
"MonVersionDef::setByID: Given def_id is not in the database"));
102 m_conn->terminateStatement(stmt);
103 }
catch (SQLException &
e) {
104 throw(std::runtime_error(
std::string(
"MonVersionDef::setByID: ")+e.getMessage()));
113 this->checkConnection();
115 Statement* stmt = m_conn->createStatement();
116 stmt->setSQL(
"SELECT def_id FROM mon_version_def ORDER BY def_id");
117 ResultSet* rset = stmt->executeQuery();
122 while(rset->next()) {
123 monVersionDef.
setByID( rset->getInt(1) );
124 fillVec->push_back( monVersionDef );
126 }
catch (SQLException &
e) {
127 throw(std::runtime_error(
std::string(
"MonVersionDef::fetchAllDefs: ")+e.getMessage()));
void setByID(int id) noexcept(false) override
std::string getDescription() const
int fetchID() noexcept(false) override
void fetchAllDefs(std::vector< MonVersionDef > *fillVec) noexcept(false)
void setMonitoringVersion(std::string ver)
void setConnection(oracle::occi::Environment *env, oracle::occi::Connection *conn)
std::string getMonitoringVersion() const
~MonVersionDef() override