kexi

mysqlcursor.h
1/* This file is part of the KDE project
2Copyright (C) 2003 Joseph Wenninger<jowenn@kde.org>
3
4This program is free software; you can redistribute it and/or
5modify it under the terms of the GNU Library General Public
6License as published by the Free Software Foundation; either
7version 2 of the License, or (at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12Library General Public License for more details.
13
14You should have received a copy of the GNU Library General Public License
15along with this program; see the file COPYING. If not, write to
16the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18*/
19
20#ifndef _MYSQLCURSOR_H_
21#define _MYSQLCURSOR_H_
22
23#include <kexidb/cursor.h>
24#include <kexidb/connection.h>
25
26namespace KexiDB {
27
28class MySqlCursorData;
29
30class MySqlCursor: public Cursor {
31public:
32 MySqlCursor(Connection* conn, const TQString& statement = TQString(), uint cursor_options = NoOptions );
33 MySqlCursor(Connection* conn, QuerySchema& query, uint options = NoOptions );
34 virtual ~MySqlCursor();
35 virtual bool drv_open();
36 virtual bool drv_close();
37// virtual bool drv_moveFirst();
38 virtual void drv_getNextRecord();
39 //virtual bool drv_getPrevRecord();
40 virtual TQVariant value(uint);
41
42 virtual void drv_clearServerResult();
44 virtual void drv_bufferMovePointerNext();
45 virtual void drv_bufferMovePointerPrev();
46 virtual void drv_bufferMovePointerTo(TQ_LLONG to);
47 virtual const char** rowData() const;
48 virtual void storeCurrentRow(RowData &data) const;
49// virtual bool save(RowData& data, RowEditBuffer& buf);
50
51 virtual int serverResult();
52 virtual TQString serverResultName();
53 virtual TQString serverErrorMsg();
54
55protected:
56 TQVariant pValue(uint pos) const;
57// MYSQL_RES *m_res;
58// MYSQL_ROW m_row;
59// MYSQL *my_conn;
60// unsigned long *m_lengths;
61//js: int m_numFields;
62// unsigned long m_numRows;
63 MySqlCursorData *d;
64};
65
66}
67
68#endif
Provides database cursor functionality.
Definition cursor.h:67
virtual TQString serverResultName()
Definition cursor.h:240
virtual void drv_appendCurrentRecordToBuffer()=0
virtual int serverResult()
Definition cursor.h:233
virtual void drv_bufferMovePointerNext()=0
virtual void drv_bufferMovePointerPrev()=0
uint options() const
Definition cursor.h:118
virtual const char ** rowData() const =0
virtual TQString serverErrorMsg()
Definition cursor.h:247
QuerySchema * query() const
Definition cursor.h:104
virtual void drv_clearServerResult()=0
High-level database connectivity library with database backend drivers.
TQValueVector< TQVariant > RowData
structure for storing single record with type information
Definition connection.h:47