kexi

mysqlconnection.h
1/* This file is part of the KDE project
2 Copyright (C) 2002 Lucijan Busch <lucijan@gmx.at>
3 Copyright (C) 2003 Joseph Wenninger<jowenn@kde.org>
4 Copyright (C) 2004 Jaroslaw Staniek <js@iidea.pl>
5
6This program is free software; you can redistribute it and/or
7modify it under the terms of the GNU Library General Public
8License as published by the Free Software Foundation; either
9version 2 of the License, or (at your option) any later version.
10
11This program is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14Library General Public License for more details.
15
16You should have received a copy of the GNU Library General Public License
17along with this program; see the file COPYING. If not, write to
18the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
20*/
21
22#ifndef MYSQLCONNECTION_H
23#define MYSQLCONNECTION_H
24
25#include <tqstringlist.h>
26
27#include <kexidb/connection.h>
28#include "mysqlcursor.h"
29#include <tqdict.h>
30
31namespace KexiDB {
32
33class MySqlConnectionInternal;
34
41{
42 TQ_OBJECT
43
44
45 public:
46 virtual ~MySqlConnection();
47
48 virtual Cursor* prepareQuery( const TQString& statement = TQString(), uint cursor_options = 0 );
49 virtual Cursor* prepareQuery( QuerySchema& query, uint cursor_options = 0 );
50
51 virtual PreparedStatement::Ptr prepareStatement(PreparedStatement::StatementType type,
52 FieldList& fields);
53
54 protected:
55
57 MySqlConnection( Driver *driver, ConnectionData &conn_data );
58
60 virtual bool drv_disconnect();
61 virtual bool drv_getDatabasesList( TQStringList &list );
62 virtual bool drv_createDatabase( const TQString &dbName = TQString() );
63 virtual bool drv_useDatabase( const TQString &dbName = TQString(), bool *cancelled = 0,
64 MessageHandler* msgHandler = 0 );
65 virtual bool drv_closeDatabase();
66 virtual bool drv_dropDatabase( const TQString &dbName = TQString() );
67 virtual bool drv_executeSQL( const TQString& statement );
68 virtual TQ_ULLONG drv_lastInsertRowID();
69
70 virtual int serverResult();
71 virtual TQString serverResultName();
72 virtual TQString serverErrorMsg();
73 virtual void drv_clearServerResult();
74
75//TODO: move this somewhere to low level class (MIGRATION?)
76 virtual bool drv_getTablesList( TQStringList &list );
77//TODO: move this somewhere to low level class (MIGRATION?)
78 virtual bool drv_containsTable( const TQString &tableName );
79
80 MySqlConnectionInternal* d;
81
82 friend class MySqlDriver;
83 friend class MySqlCursor;
84};
85
86}
87
88#endif
Database specific connection data, e.g. host, port.
Driver * driver() const
Definition connection.h:78
Connection(Driver *driver, ConnectionData &conn_data)
virtual Cursor * prepareQuery(const TQString &statement=TQString(), uint cursor_options=0)
virtual bool drv_getTablesList(TQStringList &list)
virtual bool drv_connect(KexiDB::ServerVersionInfo &version)
virtual TQString serverErrorMsg()
virtual bool drv_executeSQL(const TQString &statement)
virtual PreparedStatement::Ptr prepareStatement(PreparedStatement::StatementType type, FieldList &fields)
virtual void drv_clearServerResult()
virtual bool drv_getDatabasesList(TQStringList &list)
virtual bool drv_dropDatabase(const TQString &dbName=TQString())
virtual bool drv_useDatabase(const TQString &dbName=TQString(), bool *cancelled=0, MessageHandler *msgHandler=0)
virtual bool drv_containsTable(const TQString &tableName)
virtual TQ_ULLONG drv_lastInsertRowID()
virtual bool drv_createDatabase(const TQString &dbName=TQString())
virtual TQString serverResultName()
MySqlConnection(Driver *driver, ConnectionData &conn_data)
StatementType
Defines type of the prepared statement.
KexiDB::QuerySchema provides information about database query.
Contains version information about a database backend.
Definition global.h:126
High-level database connectivity library with database backend drivers.
KEXI_DB_EXPORT DatabaseVersionInfo version()
Definition global.cpp:55