00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef __XVR2_SQL_ConnectionMT_H__
00015 #define __XVR2_SQL_ConnectionMT_H__
00016
00017 #include<xvr2/xvr2config.h>
00018 #include<xvr2/SQL/Driver.h>
00019 #include<xvr2/SQL/Connection.h>
00020 #include<xvr2/Mutex.h>
00021
00022 namespace xvr2{
00023 namespace SQL {
00029 class ConnectionMT:public Connection {
00030 private:
00031 Mutex mt;
00032 protected:
00033 public:
00035 ConnectionMT(Driver *drv);
00039 ConnectionMT(Driver *drv, const String &server,
00040 const String &dbname,
00041 const String &u, const String &p,
00042 int port = 0);
00044 ~ConnectionMT();
00045 ConnectionMT();
00051 void connect(const String &server, const String &u,
00052 const String &dbname,
00053 const String &p, int port = 0);
00059 void connect(Driver *d, const String &server, const String &u,
00060 const String &dbname,
00061 const String &p, int port = 0);
00065 void connect();
00068 void disconnect();
00078 ResultSet *query(const String &cmd);
00079 ResultSet *query(const StringBuffer &cmd);
00083 int execCommand(const String &cmd);
00087 int execCommand(const StringBuffer &cmd);
00093 void commit();
00094 void bulkUploadBegin(const String &table, const String &cols, const String &_delim);
00095 void bulkUploadData(const String &data);
00096 void bulkUploadEnd();
00097
00098 String escapeString(const String &s);
00099 char *escapeString(const char *);
00100 const char *errorMessage();
00102 const bool isConnected();
00103 };
00104 };
00105 };
00106
00107 #endif