hk_mysqldatasource.h

00001 // ****************************************************************************
00002 // copyright (c) 2000-2005 Horst Knorr <hk_classes@knoda.org>
00003 // This file is part of the hk_mysqlclasses library.
00004 // This file may be distributed and/or modified under the terms of the
00005 // GNU Library Public License version 2 as published by the Free Software
00006 // Foundation and appearing in the file COPYING included in the
00007 // packaging of this file.
00008 // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00009 // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00010 // ****************************************************************************
00011 #ifndef HK_MYSQLDATASOURCE
00012 #define HK_MYSQLDATASOURCE
00013 #include <mysql.h>
00014 #include "hk_storagedatasource.h"
00015 #include "hk_mysqlcolumn.h"
00016 #include "hk_column.h"
00017 #include <list>
00018 #include <vector>
00019 #include <algorithm>
00020 
00021 class hk_mysqldatabase;
00022 class hk_mysqlconnection;
00023 class hk_presentation;
00024 
00025 class hk_mysqldatasource:public hk_storagedatasource
00026 {
00027     friend class hk_mysqldatabase;
00028 
00029     public:
00030         hk_mysqlconnection* mysqlconnection(void);
00031 
00032         MYSQL* dbhandler(void);
00033         virtual void    set_name(const hk_string& n,bool registerchange=true);
00034 
00035     protected:
00036         hk_mysqldatasource(hk_mysqldatabase* d,hk_presentation* p);
00037         virtual ~hk_mysqldatasource();
00038 
00039         bool driver_specific_enable(void);
00040         virtual list<hk_column*>* driver_specific_columns(void);
00041         virtual bool driver_specific_create_columns(void);
00042         virtual bool driver_specific_insert_data(void);
00043         hk_mysqldatabase* p_mysqldatabase;
00044         virtual hk_column* driver_specific_new_column(void);
00045         virtual bool driver_specific_batch_enable(void);
00046         virtual bool driver_specific_batch_disable(void);
00047         virtual bool driver_specific_batch_goto_next(void);
00048 
00049     private:
00050         void add_data(unsigned int numfields);
00051         void set_handle(void);
00052         MYSQL_RES* p_result;
00053         MYSQL_ROW p_row;
00054         unsigned long *p_length;
00055         MYSQL* p_SQL_Connection;
00056         void set_uniquenames(list<hk_column*>::iterator);
00057 }
00058 
00059 
00060 ;
00061 #endif

Generated on Tue Nov 28 02:48:08 2006 for Databaseconnectionclasses by  doxygen 1.5.0