00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00035 #ifndef __vtkMySQLQuery_h
00036 #define __vtkMySQLQuery_h
00037
00038 #include "vtkSQLQuery.h"
00039
00040 class vtkMySQLDatabase;
00041 class vtkVariant;
00042 class vtkVariantArray;
00043 class vtkMySQLQueryInternals;
00044
00045 class VTK_IO_EXPORT vtkMySQLQuery : public vtkSQLQuery
00046 {
00047
00048 friend class vtkMySQLDatabase;
00049
00050
00051 public:
00052 vtkTypeMacro(vtkMySQLQuery, vtkSQLQuery);
00053 void PrintSelf(ostream& os, vtkIndent indent);
00054 static vtkMySQLQuery *New();
00055
00058 bool SetQuery(const char *query);
00059
00062 bool Execute();
00063
00065 int GetNumberOfFields();
00066
00068 const char* GetFieldName(int i);
00069
00072 int GetFieldType(int i);
00073
00075 bool NextRow();
00076
00078 bool HasError();
00079
00080
00082
00083 vtkVariant DataValue(vtkIdType c);
00084
00086
00088 const char* GetLastErrorText();
00089
00091
00096 using vtkSQLQuery::BindParameter;
00097 bool BindParameter(int index, unsigned char value);
00098 bool BindParameter(int index, signed char value);
00099 bool BindParameter(int index, unsigned short value);
00100 bool BindParameter(int index, signed short value);
00101 bool BindParameter(int index, unsigned int value);
00103
00104 bool BindParameter(int index, int value);
00105
00106 bool BindParameter(int index, unsigned long value);
00107 bool BindParameter(int index, signed long value);
00108 bool BindParameter(int index, vtkTypeUInt64 value);
00109 bool BindParameter(int index, vtkTypeInt64 value);
00110
00111 bool BindParameter(int index, float value);
00112 bool BindParameter(int index, double value);
00114
00115 bool BindParameter(int index, const char *stringValue);
00116
00117
00118 bool BindParameter(int index, const char *stringValue, size_t length);
00120
00121 bool BindParameter(int index, const vtkStdString &string);
00122
00124
00126 bool BindParameter(int index, const void *data, size_t length);
00127 bool ClearParameterBindings();
00129
00130
00132
00133 virtual vtkStdString EscapeString( vtkStdString src, bool addSurroundingQuotes = true );
00134
00136
00137 protected:
00138 vtkMySQLQuery();
00139 ~vtkMySQLQuery();
00140
00141 vtkSetStringMacro(LastErrorText);
00142
00143 private:
00144 vtkMySQLQuery(const vtkMySQLQuery &);
00145 void operator=(const vtkMySQLQuery &);
00146
00147 vtkMySQLQueryInternals *Internals;
00148 bool InitialFetch;
00149 char *LastErrorText;
00150 };
00151
00152 #endif // __vtkMySQLQuery_h
00153