Source: sqlconnectioninterface.h


Annotated List
Files
Globals
Hierarchy
Index
// ##########################################################################
// ####                                                                  ####
// ####                         Prüfungsamt-Client                       ####
// ####                    ============================                  ####
// ####                                                                  ####
// #### Datenbank-Verbindungs-Interface                                  ####
// ####                                                                  ####
// #### Version 1.00  --  25. Juni 2000                                  ####
// ####                                                                  ####
// #### Copyright (C) 2000  Thomas Dreibholz                             ####
// ####                     Universität Bonn                             ####
// ####                     EMail: Dreibholz@bigfoot.com                 ####
// ####                     WWW:   http://www.bigfoot.com/~dreibholz     ####
// ####                                                                  ####
// ##########################################################################


#ifndef SQL_CONNECTION_INTERFACE_H
#define SQL_CONNECTION_INTERFACE_H


#include "system.h"
#include "sqlexception.h"
#include "sqlmonitorinterface.h"


/**
  * SQLConnectionInterface ist ein Interface für eine Verbindung zu
  * einer SQL-Datenbank.
  *
  * @short   SQL Connection Interface
  * @author  Thomas Dreibholz (Dreibholz@bigfoot.com)
  * @version 1.0
  */
class SQLConnectionInterface
{
   // ====== Transaktionsbefehle ============================================
   public:
   /**
     * Beginn einer Transaktion.
     * Bei Fehler wird eine SQL-Exception aufgeworfen.
     */
   virtual void beginTransaction() = 0;

   /**
     * Ende einer Transaktion mit Commit.
     * Bei Fehler wird eine SQL-Exception aufgeworfen und ein Rollback
     * gesendet.
     */
   virtual void commitTransaction() = 0;

   /**
     * Ende einer Transaktion mit Rollback.
     * Bei Fehler wird eine SQL-Exception aufgeworfen.
     */
   virtual void rollbackTransaction() = 0;


   // ====== Befehl ausführen ===============================================
   /**
     * Ausführung einer SQL-Anweisung.
     * Bei Fehler wird eine SQL-Exception aufgeworfen.
     *
     * @param command SQL-Befehl.
     */
   virtual void execute(const char* command) = 0;


   // ====== Cursor-Befehle =================================================
   /**
     * Erstellen eines neuen SQL-Cursors für einen gegebenen Befehl.
     * Bei Fehler wird eine SQL-Exception aufgeworfen.
     *
     * @param cursorName Name des Cursors.
     * @param command SQL-Befehl.
     */
   virtual void createCursor(const char* cursorName, const char* command) = 0;

   /**
     * Fetch-Ausführung für einen gegebenen SQL-Cursor.
     * Bei Fehler wird eine SQL-Exception aufgeworfen.
     *
     * @param cursorName Name des Cursors.
     * @param what Beschreibung des Fetch-Bereichs, z.B. "ALL".
     */
   virtual void fetchCursor(const char* cursorName, const char* what = "ALL") = 0;

   /**
     * Entfernen eines SQL-Cursors.
     * Bei Fehler wird eine SQL-Exception aufgeworfen.
     *
     * @param cursorName Name des Cursors.
     */
   virtual void deleteCursor(const char* cursorName) = 0;

   /**
     * Anzahl der Tupel im Cursor zurückgeben.
     *
     * @return Anzahl der Tupel.
     */
   virtual cardinal getTuples() = 0;

   /**
     * Anzahl der Attribute im Cursor zurückgeben.
     *
     * @return Anzahl der Attribute.
     */
   virtual cardinal getFields() = 0;

   /**
     * Attributnamen für gegebene Spalte zurückgeben.
     *
     * @param col Spalten-Nummer.
     * @return Attributname.
     */
   virtual const char* getField(cardinal col) = 0;

   /**
     * Wert in gegebener Zeile und Spalte zurückgeben.
     *
     * @param row Zeilen-Nummer.
     * @param col Spalten-Nummer.
     * @return Wert
     */
   virtual const char* getValue(cardinal row, cardinal col) = 0;


   // ====== Optimierung ====================================================
   /**
     * Tabelle optimieren.
     * Bei Fehler wird eine SQL-Exception aufgeworfen.
     *
     * @param tableName Tabellen-Name.
     */
   virtual void optimize(const char* tableName) = 0;


   // ====== SQL-Monitor-Befehle ============================================
   /**
     * Zeige auf SQLMonitorInterface zurückgeben.
     *
     * @return SQLMonitorInterface.
     */
   virtual SQLMonitorInterface* getMonitor() const = 0;

   /**
     * SQLMonitorInterface setzen
     *
     * @param monitor SQLMonitorInterface.
     */
   virtual void setMonitor(SQLMonitorInterface* monitor) = 0;
};


#endif

Generated by: viper@odin on Wed Jul 12 17:11:55 2000, using kdoc 2.0a22.