1 #include "../../include/db/sqlite3db/sqlite3recordset.h"
\r
12 Recordset::Recordset()
\r
20 Recordset::Recordset(char **rs, int rows, int cols)
\r
28 Recordset::~Recordset()
\r
33 const char *Recordset::Get(const int row, const int field)
\r
35 if(row>=0 && row<m_rows && field>=0 && field<m_cols)
\r
37 return m_rs[m_cols+(m_cols*row)+field];
\r
45 const char *Recordset::GetColumnName(const int column)
\r
47 if(column>=0 && column<m_cols)
\r
49 return m_rs[column];
\r
57 const double Recordset::GetDouble(const int field)
\r
59 const char *result=GetField(field);
\r
62 return atof(result);
\r
70 const char *Recordset::GetField(const int field)
\r
72 return Get(m_currentrow,field);
\r
75 const int Recordset::GetInt(const int field)
\r
77 const char *result=GetField(field);
\r
80 return atoi(result);
\r
88 void Recordset::Open(const std::string &sql, DB *db)
\r
93 Poco::ScopedLock<Poco::FastMutex> g(DB::Instance()->m_mutex);
\r
94 if(sqlite3_get_table(db->GetDB(),sql.c_str(),&m_rs,&m_rows,&m_cols,NULL)==SQLITE_OK)
\r