8 using namespace oracle::occi;
37 if (desc != m_shortDesc) {
53 throw(std::runtime_error)
60 this->checkConnection();
63 Statement* stmt = m_conn->createStatement();
64 stmt->setSQL(
"SELECT def_id FROM mon_run_outcome_def WHERE "
66 stmt->setString(1, m_shortDesc);
71 m_ID = rset->getInt(1);
75 m_conn->terminateStatement(stmt);
77 throw(std::runtime_error(
"MonRunOutcomeDef::fetchID: "+e.getMessage()));
86 throw(std::runtime_error)
88 this->checkConnection();
91 Statement* stmt = m_conn->createStatement();
93 stmt->setSQL(
"SELECT short_desc, long_desc FROM mon_run_outcome_def WHERE def_id = :1");
98 m_shortDesc = rset->getString(1);
99 m_longDesc = rset->getString(2);
102 throw(std::runtime_error(
"MonRunOutcomeDef::setByID: Given def_id is not in the database"));
105 m_conn->terminateStatement(stmt);
107 throw(std::runtime_error(
"MonRunOutcomeDef::setByID: "+e.getMessage()));
114 throw(std::runtime_error)
116 this->checkConnection();
118 Statement* stmt = m_conn->createStatement();
119 stmt->setSQL(
"SELECT def_id FROM mon_run_outcome_def ORDER BY def_id");
125 while(rset->next()) {
126 def.
setByID( rset->getInt(1) );
127 fillVec->push_back( def );
130 throw(std::runtime_error(
"MonRunOutcomeDef::fetchAllDefs: "+e.getMessage()));
std::string getShortDesc() const
oracle::occi::SQLException SQLException
void setShortDesc(std::string desc)
std::string getLongDesc() const
void fetchAllDefs(std::vector< MonRunOutcomeDef > *fillVec)
virtual ~MonRunOutcomeDef()
oracle::occi::ResultSet ResultSet
void setConnection(oracle::occi::Environment *env, oracle::occi::Connection *conn)