Version: 1.0.0
wxPreparedStatement Class Referenceabstract

#include <prepared_statement.h>

+ Inheritance diagram for wxPreparedStatement:

Detailed Description

Definition at line 8 of file prepared_statement.h.

Public Member Functions

 wxPreparedStatement ()
 Constructor. More...
 
virtual ~wxPreparedStatement ()
 Destructor. More...
 
virtual void Close ()=0
 Close the result set (call wxDatabase::ClosePreparedStatement() instead on the statement) More...
 
virtual void SetParamInt (int nPosition, int nValue)=0
 Set the parameter at the 1-based position to an int value. More...
 
virtual void SetParamDouble (int nPosition, double dblValue)=0
 Set the parameter at the 1-based position to a double value. More...
 
virtual void SetParamString (int nPosition, const wxString &strValue)=0
 Set the parameter at the 1-based position to a wxString value. More...
 
virtual void SetParamNull (int nPosition)=0
 Set the parameter at the 1-based position to a NULL value. More...
 
virtual void SetParamBlob (int nPosition, const wxMemoryBuffer &buffer)
 Set the parameter at the 1-based position to a Blob value. More...
 
virtual void SetParamBlob (int nPosition, const void *pData, long nDataLength)=0
 Set the parameter at the 1-based position to a Blob value. More...
 
virtual void SetParamDate (int nPosition, const wxDateTime &dateValue)=0
 Set the parameter at the 1-based position to a wxDateTime value. More...
 
virtual void SetParamBool (int nPosition, bool bValue)=0
 Set the parameter at the 1-based position to a boolean value. More...
 
virtual int GetParameterCount ()=0
 
virtual int RunQuery ()=0
 Run an insert, update, or delete query on the database. More...
 
virtual wxDatabaseResultSetRunQueryWithResults ()=0
 Run an insert, update, or delete query on the database. More...
 
int ExecuteUpdate ()
 See RunQuery. More...
 
wxDatabaseResultSetExecuteQuery ()
 See RunQueryWithResults. More...
 
virtual bool CloseResultSet (wxDatabaseResultSet *pResultSet)
 Close a result set returned by the database or a prepared statement previously. More...
 
- Public Member Functions inherited from wxDatabaseErrorReporter
 wxDatabaseErrorReporter ()
 
virtual ~wxDatabaseErrorReporter ()
 
const wxString & GetErrorMessage ()
 
int GetErrorCode ()
 
void ResetErrorCodes ()
 
- Public Member Functions inherited from wxDatabaseStringConverter
 wxDatabaseStringConverter ()
 
 wxDatabaseStringConverter (const wxChar *charset)
 
virtual ~wxDatabaseStringConverter ()
 
void SetEncoding (wxFontEncoding encoding)
 
void SetEncoding (const wxCSConv *conv)
 
const wxCSConv * GetEncoding ()
 
virtual const wxCharBuffer ConvertToUnicodeStream (const wxString &inputString)
 
virtual size_t GetEncodedStreamLength (const wxString &inputString)
 
virtual wxString ConvertFromUnicodeStream (const char *inputBuffer)
 
virtual wxString ConvertFromUnicodeStream (const wxChar *inputBuffer)
 

Protected Member Functions

void CloseResultSets ()
 Close all result set objects that have been generated but not yet closed. More...
 
void LogResultSetForCleanup (wxDatabaseResultSet *pResultSet)
 Add result set object pointer to the list for "garbage collection". More...
 
- Protected Member Functions inherited from wxDatabaseErrorReporter
void SetErrorMessage (const wxString &strErrorMessage)
 
void SetErrorCode (int nErrorCode)
 
void ThrowDatabaseException ()
 

Private Attributes

StatementResultSetHashSet m_ResultSets
 

Additional Inherited Members

- Static Public Member Functions inherited from wxDatabaseStringConverter
static const wxCharBuffer ConvertToUnicodeStream (const wxString &inputString, const char *encoding)
 
static wxString ConvertFromUnicodeStream (const char *inputBuffer, const char *encoding)
 
static size_t GetEncodedStreamLength (const wxString &inputString, const char *encoding)
 
static wxString ConvertFromUnicodeStream (const wxChar *inputBuffer, const char *encoding)
 

Constructor & Destructor Documentation

◆ wxPreparedStatement()

wxPreparedStatement::wxPreparedStatement ( )

Constructor.

Definition at line 4 of file prepared_statement.cpp.

◆ ~wxPreparedStatement()

wxPreparedStatement::~wxPreparedStatement ( )
virtual

Destructor.

Definition at line 10 of file prepared_statement.cpp.

References CloseResultSets().

Member Function Documentation

◆ Close()

virtual void wxPreparedStatement::Close ( )
pure virtual

Close the result set (call wxDatabase::ClosePreparedStatement() instead on the statement)

Implemented in wxOdbcPreparedStatement, wxMysqlPreparedStatement, wxSqlitePreparedStatement, wxPostgresPreparedStatement, and wxTdsPreparedStatement.

◆ CloseResultSet()

bool wxPreparedStatement::CloseResultSet ( wxDatabaseResultSet pResultSet)
virtual

Close a result set returned by the database or a prepared statement previously.

Definition at line 31 of file prepared_statement.cpp.

References m_ResultSets.

Referenced by wxDatabase::CloseResultSet().

◆ CloseResultSets()

void wxPreparedStatement::CloseResultSets ( )
protected

Close all result set objects that have been generated but not yet closed.

Definition at line 16 of file prepared_statement.cpp.

References m_ResultSets.

Referenced by ~wxPreparedStatement().

◆ ExecuteQuery()

wxDatabaseResultSet* wxPreparedStatement::ExecuteQuery ( )
inline

See RunQueryWithResults.

Definition at line 49 of file prepared_statement.h.

◆ ExecuteUpdate()

int wxPreparedStatement::ExecuteUpdate ( )
inline

See RunQuery.

Definition at line 47 of file prepared_statement.h.

◆ GetParameterCount()

virtual int wxPreparedStatement::GetParameterCount ( )
pure virtual

◆ LogResultSetForCleanup()

void wxPreparedStatement::LogResultSetForCleanup ( wxDatabaseResultSet pResultSet)
inlineprotected

Add result set object pointer to the list for "garbage collection".

Definition at line 58 of file prepared_statement.h.

◆ RunQuery()

virtual int wxPreparedStatement::RunQuery ( )
pure virtual

Run an insert, update, or delete query on the database.

Implemented in wxOdbcPreparedStatement, wxMysqlPreparedStatement, wxSqlitePreparedStatement, wxPostgresPreparedStatement, and wxTdsPreparedStatement.

◆ RunQueryWithResults()

virtual wxDatabaseResultSet* wxPreparedStatement::RunQueryWithResults ( )
pure virtual

Run an insert, update, or delete query on the database.

Implemented in wxOdbcPreparedStatement, wxMysqlPreparedStatement, wxSqlitePreparedStatement, wxPostgresPreparedStatement, and wxTdsPreparedStatement.

◆ SetParamBlob() [1/2]

void wxPreparedStatement::SetParamBlob ( int  nPosition,
const wxMemoryBuffer &  buffer 
)
virtual

Set the parameter at the 1-based position to a Blob value.

Definition at line 53 of file prepared_statement.cpp.

◆ SetParamBlob() [2/2]

virtual void wxPreparedStatement::SetParamBlob ( int  nPosition,
const void *  pData,
long  nDataLength 
)
pure virtual

Set the parameter at the 1-based position to a Blob value.

Implemented in wxOdbcPreparedStatement, wxMysqlPreparedStatement, wxSqlitePreparedStatement, wxPostgresPreparedStatement, and wxTdsPreparedStatement.

◆ SetParamBool()

virtual void wxPreparedStatement::SetParamBool ( int  nPosition,
bool  bValue 
)
pure virtual

Set the parameter at the 1-based position to a boolean value.

Implemented in wxOdbcPreparedStatement, wxMysqlPreparedStatement, wxSqlitePreparedStatement, wxPostgresPreparedStatement, and wxTdsPreparedStatement.

◆ SetParamDate()

virtual void wxPreparedStatement::SetParamDate ( int  nPosition,
const wxDateTime &  dateValue 
)
pure virtual

Set the parameter at the 1-based position to a wxDateTime value.

Implemented in wxOdbcPreparedStatement, wxMysqlPreparedStatement, wxSqlitePreparedStatement, wxPostgresPreparedStatement, and wxTdsPreparedStatement.

◆ SetParamDouble()

virtual void wxPreparedStatement::SetParamDouble ( int  nPosition,
double  dblValue 
)
pure virtual

Set the parameter at the 1-based position to a double value.

Implemented in wxOdbcPreparedStatement, wxMysqlPreparedStatement, wxSqlitePreparedStatement, wxPostgresPreparedStatement, and wxTdsPreparedStatement.

◆ SetParamInt()

virtual void wxPreparedStatement::SetParamInt ( int  nPosition,
int  nValue 
)
pure virtual

Set the parameter at the 1-based position to an int value.

Implemented in wxOdbcPreparedStatement, wxMysqlPreparedStatement, wxSqlitePreparedStatement, wxPostgresPreparedStatement, and wxTdsPreparedStatement.

◆ SetParamNull()

virtual void wxPreparedStatement::SetParamNull ( int  nPosition)
pure virtual

Set the parameter at the 1-based position to a NULL value.

Implemented in wxOdbcPreparedStatement, wxMysqlPreparedStatement, wxSqlitePreparedStatement, wxPostgresPreparedStatement, and wxTdsPreparedStatement.

◆ SetParamString()

virtual void wxPreparedStatement::SetParamString ( int  nPosition,
const wxString &  strValue 
)
pure virtual

Set the parameter at the 1-based position to a wxString value.

Implemented in wxOdbcPreparedStatement, wxMysqlPreparedStatement, wxSqlitePreparedStatement, wxPostgresPreparedStatement, and wxTdsPreparedStatement.

Member Data Documentation

◆ m_ResultSets

StatementResultSetHashSet wxPreparedStatement::m_ResultSets
private

Definition at line 61 of file prepared_statement.h.

Referenced by CloseResultSet(), and CloseResultSets().