/* mini * * This program is distributed under the GNU General Public License, version 2. * A copy of this license is included with this source. * * Copyright 2004-2006, Toni Thomsson */ // Implementation of class CTestData #include "test_table_data.h" #include // Construction CTestTableData::CTestTableData( void ) : CzzDataService( "TestTable" ) { } // Destruction CTestTableData::~CTestTableData() { } CzzDataServiceReply* CTestTableData::execute( void* session, CzzParameterMap* req ) { CzzDataService::execute( session, req ); CzzDataServiceReply* reply = new CzzDataServiceReply(); CzzDb* db = (CzzDb*)((MINI_SESSION*)session)->extension; CzzSQLStream* stream = NULL; reply->addFieldName( "row" ); try { char row[51]; stream = db->getStream( "select name from test", 1 ); stream->flush(); while( !stream->eof() ) { *stream >> row; reply->addFieldValue( row ); } delete stream; } catch( otl_exception& e ) { delete stream; throw CzzLogException( _LAF, 4711, (char*)e.msg ); } return reply; } int CTestTableData::size() { return sizeof(CTestTableData); }