Driver.h

Go to the documentation of this file.
00001 /*
00002  * $Id:Driver.h 540 2007-08-20 07:51:56Z mindstorm2600 $
00003  *
00004  * X-VR2 
00005  * 
00006  * Copyright (C) Juan V. Guerrero 2007
00007  * 
00008  * Juan V. Guerrero <mindstorm2600@users.sourceforge.net>
00009  * 
00010  * This program is free software, distributed under the terms of
00011  * the GNU General Public License Version 2. See the LICENSE file
00012  * at the top of the source tree.
00013  */
00014 #ifndef __XVR2_SQL_DRIVER_H__
00015 #define __XVR2_SQL_DRIVER_H__
00016  
00017 
00018 #include<xvr2/xvr2config.h>
00019 #include<xvr2/SQL/DriverInfo.h>
00020 
00021 
00022 namespace xvr2 {
00023         namespace SQL {
00024                 class ResultSet;
00025                 class Field;
00026 
00027                 /* @brief Interface class for database drivers. */
00028                 class Driver:public Object {
00029                         private:
00030                         protected:
00031                         public:
00035                                 bool conn_requires_lock;
00038                                 bool query_requires_lock;
00039                                 bool bulk_requires_specific_lock;
00040                                 bool resultset_requires_lock;
00041                                 Driver();
00044                                 virtual const SQL::DriverInfo &getVersionInfo() = 0;
00057                                 virtual void *connect(const String &server, 
00058                                                       const String &__dbname,
00059                                                       const String &user, const String &pass,
00060                                                       int port = 0) = 0;
00071                                 virtual void *connect(const String &dbsock, 
00072                                                                 const String &_dbname, const String &_user, 
00073                                                                 const String &_pass) = 0;
00082                                 virtual void *open(const String &dbfile) = 0;
00088                                 virtual ResultSet *query(void *__handle, 
00089                                                          const String &command) = 0;
00098                                 virtual int execCommand(void *__handle, 
00099                                                          const String &command) = 0;
00103                                 virtual bool disconnect(void *__handle) = 0;
00111                                 virtual void setAutoCommit(bool val = true) = 0;
00117                                 virtual void commit(void *__handle) = 0;
00120                                 virtual const int numRows(void *__res_handle) = 0;
00123                                 virtual const int numCols(void *__res_handle) = 0;
00126                                 virtual Field *fetchRow(void *__res_handle) = 0;
00130                                 virtual const bool freeResultSet(void *__res_handle) = 0;
00142                                 virtual const bool bulkBegin(void *conn_handle, const char *tablename, const char *cols, const char *delim) = 0;
00149                                 virtual const bool bulkAddData(void *conn_handle, const char *data, const char *delim) = 0;
00153                                 virtual const bool bulkEnd(void *conn_handle) = 0;
00160                                 virtual char *quoteString(const char *str) = 0;
00167                                 virtual String escapeString(const String &s) = 0;
00174                                 virtual String escapeString(const String &s, void *conn_handle) = 0;
00175 
00180                                 virtual const char *errorMessage(void *conn_handle) = 0;
00185                                 virtual const char *resultErrorMessage(void *res_handle) = 0;
00187                                 virtual const bool isConnected(void *conn_handle) = 0;
00189                                 virtual const bool hasConnPolling() = 0;
00190                 };
00191         };
00192 };
00193 
00194 #endif

Generated on Fri Jun 20 22:55:48 2008 for X-VR2 SDK by  doxygen 1.5.5