hk_mysqlconnection.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_MYSQLCONNECTION
00012 #define HK_MYSQLCONNECTION
00013 #include <mysql.h>
00014 #include "hk_connection.h"
00015 #include <list>
00016 #include <vector>
00017 #include <algorithm>
00018 //#include <hk_string.h>
00019 
00020 #ifndef mysql_library_init
00021 #define mysql_library_init mysql_server_init
00022 #endif
00023 
00024 #ifndef mysql_library_end
00025 #define mysql_library_end mysql_server_end
00026 #endif
00027 
00028 class hk_drivermanager;
00029 extern "C"
00030 {
00031     hk_connection* create_connection(hk_drivermanager*);
00032     hk_string hk_classesversion(void);
00033 }
00034 
00035 
00036 class hk_mysqldatabase;
00037 class hk_mysqlconnection: public hk_connection
00038 {
00039     public:
00040         hk_mysqlconnection(hk_drivermanager* c);
00041         ~hk_mysqlconnection();
00042         MYSQL* dbhandler(void);
00043         void servermessage(void);
00044 //virtual int server_supports(void);
00045         virtual bool server_supports(support_enum)const;
00046 //virtual int server_needs(void);
00047         virtual bool server_needs(need_enum)const;
00048         virtual hk_string drivername(void) const;
00049         virtual unsigned int    default_tcp_port(void) const;
00050 
00051     protected:
00052         bool            driver_specific_connect();
00053         bool            driver_specific_disconnect();
00054         bool            driver_specific_new_password(const hk_string&);
00055         vector<hk_string>*  driver_specific_dblist(void);
00056         hk_database*        driver_specific_new_database(void);
00057 
00058     private:
00059 
00060         MYSQL* p_SQL_Connection;
00061 static int  p_reference;
00062 
00063 } ;
00064 #endif

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