KDb

SybaseConnection.h
1 /* This file is part of the KDE project
2  Copyright (C) 2007 Sharan Rao <[email protected]>
3 
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8 
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13 
14 You should have received a copy of the GNU Library General Public License
15 along with this program; see the file COPYING. If not, write to
16 the 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 
28 class SybaseConnectionInternal;
29 
30 /*! @short Provides database connection, allowing queries and data modification.
31 */
33 {
34 public:
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 
45 protected:
46 
47  /*! Used by driver */
49 
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
Provides database cursor functionality.
Definition: KDbCursor.h:68
virtual bool drv_useDatabase(const QString &dbName=QString(), bool *cancelled=0, KDbMessageHandler *msgHandler=0)
Sybase database driver.
Definition: SybaseDriver.h:26
virtual QString serverResultName() const
Implemented for KDbResultable.
Specialized string for escaping.
virtual bool drv_executeSql(const KDbEscapedString &sql)
Executes query for a raw SQL statement sql without returning resulting records.
Database driver's abstraction.
Definition: KDbDriver.h:49
virtual bool drv_getDatabasesList(QStringList *list)
virtual bool drv_afterInsert(const QString &table, KDbFieldList *fields)
virtual bool drv_createDatabase(const QString &dbName=QString())
virtual bool drv_closeDatabase()
virtual bool drv_beforeUpdate(const QString &table, KDbFieldList *fields)
Provides database connection, allowing queries and data modification.
virtual bool drv_connect()=0
virtual bool drv_getTablesList(QStringList *list)
virtual bool drv_afterUpdate(const QString &table, KDbFieldList *fields)
virtual bool drv_disconnect()
virtual bool drv_dropDatabase(const QString &dbName=QString())
KDbQuerySchema provides information about database query.
unsigned int version()
Definition: KDb.cpp:336
virtual bool drv_containsTable(const QString &tableName)
Database specific connection data, e.g. host, port.
Prepared database command for optimizing sequences of multiple database actions.
SybaseConnection(KDbDriver *driver, const KDbConnectionData &connData)
virtual bool drv_beforeInsert(const QString &table, KDbFieldList *fields)
Provides database connection, allowing queries and data modification.
Definition: KDbConnection.h:51
KDbDriver * driver() const
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Sat Jun 25 2022 06:21:34 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.