Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

Fl_ODBC_Database.h

00001 /***************************************************************************
00002                           Fl_ODBC_Database.h  -  description
00003                              -------------------
00004     begin                : Sat Dec 28 2002
00005     copyright            : (C) 2002 by Alexey Parshin
00006     email                : alexeyp@m7.tts-sf.com
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 #ifndef __Fl_ODBC_Database_H__
00019 #define __Fl_ODBC_Database_H__
00020 
00021 #include <efltk/db/Fl_Database.h>
00022 
00023 class Fl_Query;
00024 class ODBCConnection;
00025 
00026 class Fl_ODBC_Database : public Fl_Database {
00027    friend class   Fl_Query;
00028 
00029 private:
00030    ODBCConnection *m_connect;
00031 
00032    // ODBC-specific dataset description functions
00033    unsigned query_count_cols(Fl_Query *query) const;
00034    void query_col_attributes(Fl_Query *query,short column,short descType,long& value);
00035    void query_col_attributes(Fl_Query *query,short column,short descType,char *buff,int len);
00036 
00037 protected:
00038    void bind_parameters(Fl_Query *);
00039 
00040    // Operations over query handle
00041    virtual void allocate_query(Fl_Query *);
00042    virtual void deallocate_query(Fl_Query *);
00043    virtual void prepare_query(Fl_Query *);
00044    virtual void open_query(Fl_Query *);
00045    virtual void fetch_query(Fl_Query *);
00046    virtual void close_query(Fl_Query *);
00047 
00048 protected:
00049    // Connection manipulations
00050    virtual void open_connection();
00051    virtual void close_connection();
00052 
00053    Fl_String query_error(Fl_Query *) const;
00054 
00055 public:
00056    // ctor, dtor
00057    Fl_ODBC_Database(const Fl_String connString);
00058    ~Fl_ODBC_Database();
00059 
00060    // Database capabilities
00061    virtual unsigned capabilities() { return FL_DB_TRANSACTIONS|FL_DB_STMT_PREPARE; }
00062    
00063    // Transcation support
00064    virtual void begin_transaction();
00065    virtual void commit_transaction();
00066    virtual void rollback_transaction();
00067 };
00068 
00069 #define FETCH_BUFFER_SIZE 2048
00070 
00071 #endif

Generated on Thu Jul 31 15:33:44 2003 for eFLTK by doxygen1.2.15