Source: sqlconnection.h


Annotated List
Files
Globals
Hierarchy
Index
// ##########################################################################
// ####                                                                  ####
// ####                         Prüfungsamt-Client                       ####
// ####                    ============================                  ####
// ####                                                                  ####
// #### Datenbank-Verbindung                                             ####
// ####                                                                  ####
// #### 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_H
#define SQL_CONNECTION_H


#include "system.h"
#include "sqlconnectioninterface.h"


#ifdef DEBUG
#undef DEBUG
#endif
#include <libpq++.h>


/**
  * SQLConnection ist die Verbindung zur Datenbank.
  *
  * @short   SQL Connection
  * @author  Thomas Dreibholz (Dreibholz@bigfoot.com)
  * @version 1.0
  */
class SQLConnection : virtual public SQLConnectionInterface
{
   // ====== Constructor ====================================================
   /**
     * Constructor.
     *
     * @param database PgDatabase-Objekt.
     * @param monitor SQLMonitorInterface-Objekt.
     */
   public:
   SQLConnection(PgDatabase* database, SQLMonitorInterface* monitor = NULL);


   // ====== Transaktionsbefehle ============================================
   /**
     * Implementation von SQLConnectionInterface.
     *
     * @see SQLConnectionInterface#beginTransaction
     */
   void beginTransaction();

   /**
     * Implementation von SQLConnectionInterface.
     *
     * @see SQLConnectionInterface#commitTransaction
     */
   void commitTransaction();

   /**
     * Implementation von SQLConnectionInterface.
     *
     * @see SQLConnectionInterface#rollbackTransaction
     */
   void rollbackTransaction();


   // ====== Befehl ausführen ===============================================
   /**
     * Implementation von SQLConnectionInterface.
     *
     * @see SQLConnectionInterface#execute
     */
   void execute(const char* command);


   // ====== Cursor-Befehle =================================================
   /**
     * Implementation von SQLConnectionInterface.
     *
     * @see SQLConnectionInterface#createCursor
     */
   void createCursor(const char* cursorName, const char* command);

   /**
     * Implementation von SQLConnectionInterface.
     *
     * @see SQLConnectionInterface#fetchCursor
     */
   void fetchCursor(const char* cursorName, const char* what);

   /**
     * Implementation von SQLConnectionInterface.
     *
     * @see SQLConnectionInterface#deleteCursor
     */
   void deleteCursor(const char* cursorName);

   /**
     * Implementation von SQLConnectionInterface.
     *
     * @see SQLConnectionInterface#getTuples
     */
   cardinal getTuples();

   /**
     * Implementation von SQLConnectionInterface.
     *
     * @see SQLConnectionInterface#getFields
     */
   cardinal getFields();

   /**
     * Implementation von SQLConnectionInterface.
     *
     * @see SQLConnectionInterface#getField
     */
   const char* getField(cardinal col);

   /**
     * Implementation von SQLConnectionInterface.
     *
     * @see SQLConnectionInterface#getValue
     */
   const char* getValue(cardinal row, cardinal col);

   /**
     * Implementation von SQLConnectionInterface.
     *
     * @see SQLConnectionInterface#optimize
     */
   void optimize(const char* tableName);


   // ====== SQL-Monitor-Befehle ============================================
   /**
     * Implementation von SQLConnectionInterface.
     *
     * @see SQLConnectionInterface#getMonitor
     */
   SQLMonitorInterface* getMonitor() const;

   /**
     * Implementation von SQLConnectionInterface.
     *
     * @see SQLConnectionInterface#setMonitor
     */
   void setMonitor(SQLMonitorInterface* monitor);


   // ====== Private Daten ==================================================
   private:
   bool executeCommandOk(const char* command);
   bool executeTuplesOk(const char* command);


   PgDatabase*          Database;
   SQLMonitorInterface* Monitor;
   bool                 Transaction;
};


#endif

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