Version: 1.0.0
mysql_preparedStatement_resultset.h
Go to the documentation of this file.
1 #ifndef _WX_DATABASE_MYSQL_PREPARED_STATEMENT_RESULT_SET_H_
2 #define _WX_DATABASE_MYSQL_PREPARED_STATEMENT_RESULT_SET_H_
3 
4 #include "wx/database/wxprec.h"
5 
6 WX_DECLARE_HASH_MAP(int, wxMysqlPreparedStatementParameter*, wxIntegerHash, wxIntegerEqual, IntToMysqlParameterMap);
7 
9 {
10 public:
11  // ctor
13  wxMysqlPreparedStatementResultSet(wxMysqlDynamicInterface* pInterface, MYSQL_STMT* pStatement, bool bManageStatement = false);
14 
15  //dtor
17 
18  virtual bool Next();
19  virtual void Close();
20 
21  virtual int LookupField(const wxString& strField);
22 
23  // get field
24  virtual int GetResultInt(int nField);
25  virtual wxString GetResultString(int nField);
26  virtual long GetResultLong(int nField);
27  virtual bool GetResultBool(int nField);
28  virtual wxDateTime GetResultDate(int nField);
29  virtual void* GetResultBlob(int nField, wxMemoryBuffer& Buffer);
30  virtual double GetResultDouble(int nField);
31  virtual bool IsFieldNull(int nField);
32 
33  // get MetaData
35 
36 private:
37  void ClearPreviousData();
38  MYSQL_BIND* GetResultBinding(int nField);
39 
41  MYSQL_STMT* m_pStatement;
42  MYSQL_BIND* m_pResultBindings;
43 
44  StringToIntMap m_FieldLookupMap;
45 
46  IntToMysqlParameterMap m_BindingWrappers;
47 
49 };
50 
51 #endif//_WX_DATABASE_MYSQL_PREPARED_STATEMENT_RESULT_SET_H_
52 
virtual wxResultSetMetaData * GetMetaData()
Retrieve the MetaData associated with this result set.
virtual long GetResultLong(int nField)
Retrieve a long from the result set by the 1-based field index.
wxMysqlPreparedStatementResultSet(wxMysqlDynamicInterface *pInterface)
virtual int GetResultInt(int nField)
Retrieve an integer from the result set by the 1-based field index.
virtual wxDateTime GetResultDate(int nField)
Retrieve a wxDateTime from the result set by the 1-based field index.
virtual double GetResultDouble(int nField)
Retrieve a double from the result set by the 1-based field index.
virtual bool IsFieldNull(int nField)
Check if a field in the current result set record is NULL.
virtual bool GetResultBool(int nField)
Retrieve a boolean from the result set by the 1-based field index.
WX_DECLARE_HASH_MAP(int, wxMysqlPreparedStatementParameter *, wxIntegerHash, wxIntegerEqual, IntToMysqlParameterMap)
virtual void * GetResultBlob(int nField, wxMemoryBuffer &Buffer)
Retrieve a BLOB from the result set by the 1-based field index.
virtual bool Next()
Move to the next record in the result set.
virtual wxString GetResultString(int nField)
Retrieve a wxString from the result set by the 1-based field index.
MYSQL_BIND * GetResultBinding(int nField)
virtual void Close()
Close the result set (call wxDatabase::CloseResultSet() instead on the result set)
virtual int LookupField(const wxString &strField)