00001
00002
00003
00004
00005
00006
00007
00008
00009
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