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);
69 m_ID = rset->getInt(1);
73 m_conn->terminateStatement(stmt);
75 throw(std::runtime_error(
"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");
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);
104 throw(std::runtime_error(
"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");
122 while(rset->next()) {
123 monVersionDef.
setByID( rset->getInt(1) );
124 fillVec->push_back( monVersionDef );
127 throw(std::runtime_error(
"MonVersionDef::fetchAllDefs: "+e.getMessage()));
std::string getDescription() const
oracle::occi::SQLException SQLException
int fetchID() noexcept(false)
void setByID(int id) noexcept(false)
void fetchAllDefs(std::vector< MonVersionDef > *fillVec) noexcept(false)
oracle::occi::ResultSet ResultSet
void setMonitoringVersion(std::string ver)
void setConnection(oracle::occi::Environment *env, oracle::occi::Connection *conn)
std::string getMonitoringVersion() const