00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00035 #ifndef __vtkODBCQuery_h
00036 #define __vtkODBCQuery_h
00037
00038 #include "vtkSQLQuery.h"
00039
00040 class vtkODBCDatabase;
00041 class vtkVariant;
00042 class vtkVariantArray;
00043 class vtkODBCInternals;
00044 class vtkODBCQueryInternals;
00045
00046 class VTK_IO_EXPORT vtkODBCQuery : public vtkSQLQuery
00047 {
00048
00049 friend class vtkODBCDatabase;
00050
00051
00052 public:
00053 vtkTypeMacro(vtkODBCQuery, vtkSQLQuery);
00054 void PrintSelf(ostream& os, vtkIndent indent);
00055 static vtkODBCQuery *New();
00056
00059 bool Execute();
00060
00062 int GetNumberOfFields();
00063
00065 const char* GetFieldName(int i);
00066
00069 int GetFieldType(int i);
00070
00072 bool NextRow();
00073
00075 bool HasError();
00076
00077
00079 vtkVariant DataValue(vtkIdType c);
00080
00081
00083 const char* GetLastErrorText();
00084
00086
00087 bool BeginTransaction();
00088 bool CommitTransaction();
00089 bool RollbackTransaction();
00091
00093
00096 bool SetQuery(const char *queryString);
00097 const char *GetQuery();
00099
00101
00106 using vtkSQLQuery::BindParameter;
00107 bool BindParameter(int index, unsigned char value);
00108 bool BindParameter(int index, signed char value);
00109 bool BindParameter(int index, unsigned short value);
00110 bool BindParameter(int index, signed short value);
00111 bool BindParameter(int index, unsigned int value);
00113
00114 bool BindParameter(int index, int value);
00115
00116 bool BindParameter(int index, unsigned long value);
00117 bool BindParameter(int index, signed long value);
00118 bool BindParameter(int index, vtkTypeUInt64 value);
00119 bool BindParameter(int index, vtkTypeInt64 value);
00120
00121 bool BindParameter(int index, float value);
00122 bool BindParameter(int index, double value);
00124
00125 bool BindParameter(int index, const char *stringValue);
00126
00127
00128 bool BindParameter(int index, const char *stringValue, size_t length);
00130
00131 bool BindParameter(int index, const vtkStdString &string);
00132
00134
00136 bool BindParameter(int index, const void *data, size_t length);
00137 bool ClearParameterBindings();
00139
00140 protected:
00141 vtkODBCQuery();
00142 ~vtkODBCQuery();
00143
00144 vtkSetStringMacro(LastErrorText);
00145 vtkSetStringMacro(QueryText);
00146 vtkGetStringMacro(QueryText);
00147
00148 char *QueryText;
00149
00150 private:
00151 vtkODBCQuery(const vtkODBCQuery &);
00152 void operator=(const vtkODBCQuery &);
00153
00154 void ClearCurrentRow();
00155 bool CacheCurrentRow();
00156
00157 bool CacheTimeColumn(int column);
00158 bool CacheIntervalColumn(int column);
00159 bool CacheCharColumn(int column);
00160 bool CacheLongLongColumn(int column);
00161 bool CacheBinaryColumn(int column);
00162 bool CacheBooleanColumn(int column);
00163 bool CacheStringColumn(int column);
00164 bool CacheWideStringColumn(int column);
00165 bool CacheDecimalColumn(int column);
00166 bool CacheNumericColumn(int column);
00167 bool CacheIntColumn(int column);
00168 bool CacheFloatColumn(int column);
00169 bool CacheDoubleColumn(int column);
00170
00171 vtkODBCQueryInternals *Internals;
00172 bool InitialFetch;
00173 char *LastErrorText;
00174 };
00175
00176 #endif // __vtkODBCQuery_h
00177