KDb

SybaseConnection.h
1/* This file is part of the KDE project
2 Copyright (C) 2007 Sharan Rao <sharanrao@gmail.com>
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 SYBASECONNECTION_H
21#define SYBASECONNECTION_H
22
23#include <qstringlist.h>
24
25#include "KDbConnection.h"
26#include "SybaseCursor.h"
27
28class SybaseConnectionInternal;
29
30/*! @short Provides database connection, allowing queries and data modification.
31*/
33{
34public:
35 virtual ~SybaseConnection();
36
37 Q_REQUIRED_RESULT KDbCursor *prepareQuery(const KDbEscapedString &sql,
38 int cursor_options = 0) override;
39 Q_REQUIRED_RESULT KDbCursor *prepareQuery(KDbQuerySchema *query,
40 int cursor_options = 0) override;
41
42 KDbPreparedStatement prepareStatement(KDbPreparedStatement::StatementType type,
43 KDbFieldList *fields) override;
44
45protected:
46
47 /*! Used by driver */
49
50 virtual bool drv_connect(KDbServerVersionInfo* version);
51 virtual bool drv_disconnect();
52 virtual bool drv_getDatabasesList(QStringList* list);
53 virtual bool drv_createDatabase(const QString &dbName = QString());
54 virtual bool drv_useDatabase(const QString &dbName = QString(), bool *cancelled = 0,
55 KDbMessageHandler* msgHandler = 0);
56 virtual bool drv_closeDatabase();
57 virtual bool drv_dropDatabase(const QString &dbName = QString());
58 virtual bool drv_executeSql(const KDbEscapedString& sql);
59 virtual quint64 drv_lastInsertRecordId();
60
61 //! Implemented for KDbResultable
62 virtual QString serverResultName() const;
63// virtual void drv_clearServerResult();
64
65 //! @todo move this somewhere to low level class (MIGRATION?)
66 virtual bool drv_getTablesList(QStringList* list);
67 //! @todo move this somewhere to low level class (MIGRATION?)
68 virtual bool drv_containsTable(const QString &tableName);
69
70 virtual bool drv_beforeInsert(const QString& table, KDbFieldList* fields);
71 virtual bool drv_afterInsert(const QString& table, KDbFieldList* fields);
72
73 virtual bool drv_beforeUpdate(const QString& table, KDbFieldList* fields);
74 virtual bool drv_afterUpdate(const QString& table, KDbFieldList* fields);
75
76 SybaseConnectionInternal* d;
77
78 friend class SybaseDriver;
79 friend class SybaseCursor;
80};
81
82#endif
Database specific connection data, e.g. host, port.
Provides database connection, allowing queries and data modification.
KDbDriver * driver() const
virtual bool drv_connect()=0
Provides database cursor functionality.
Definition KDbCursor.h:69
Database driver's abstraction.
Definition KDbDriver.h:50
Specialized string for escaping.
Prepared database command for optimizing sequences of multiple database actions.
KDbQuerySchema provides information about database query.
Provides database connection, allowing queries and data modification.
virtual bool drv_beforeUpdate(const QString &table, KDbFieldList *fields)
SybaseConnection(KDbDriver *driver, const KDbConnectionData &connData)
virtual bool drv_executeSql(const KDbEscapedString &sql)
Executes query for a raw SQL statement sql without returning resulting records.
virtual QString serverResultName() const
Implemented for KDbResultable.
virtual bool drv_getTablesList(QStringList *list)
virtual bool drv_afterUpdate(const QString &table, KDbFieldList *fields)
virtual bool drv_afterInsert(const QString &table, KDbFieldList *fields)
virtual bool drv_createDatabase(const QString &dbName=QString())
virtual bool drv_useDatabase(const QString &dbName=QString(), bool *cancelled=0, KDbMessageHandler *msgHandler=0)
virtual bool drv_closeDatabase()
virtual bool drv_dropDatabase(const QString &dbName=QString())
virtual bool drv_beforeInsert(const QString &table, KDbFieldList *fields)
virtual bool drv_disconnect()
virtual bool drv_containsTable(const QString &tableName)
virtual bool drv_getDatabasesList(QStringList *list)
Sybase database driver.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:20:59 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.