Version: 1.0.0
wxOdbcPreparedStatement Class Reference

#include <odbc_preparedstatement.h>

+ Inheritance diagram for wxOdbcPreparedStatement:

Detailed Description

Definition at line 11 of file odbc_preparedstatement.h.

Public Member Functions

 wxOdbcPreparedStatement (wxOdbcInterface *pInterface, SQLHENV sqlEnvHandle, SQLHDBC sqlHDBC)
 
 wxOdbcPreparedStatement (wxOdbcInterface *pInterface, SQLHENV sqlEnvHandle, SQLHDBC sqlHDBC, SQLHSTMT sqlStatementHandle)
 
 wxOdbcPreparedStatement (wxOdbcInterface *pInterface, SQLHENV sqlEnvHandle, SQLHDBC sqlHDBC, wxOdbcStatementVector statements)
 
virtual ~wxOdbcPreparedStatement ()
 
virtual void Close ()
 Close the result set (call wxDatabase::ClosePreparedStatement() instead on the statement) More...
 
void AddPreparedStatement (SQLHSTMT pStatement)
 
virtual void SetParamInt (int nPosition, int nValue)
 Set the parameter at the 1-based position to an int value. More...
 
virtual void SetParamDouble (int nPosition, double dblValue)
 Set the parameter at the 1-based position to a double value. More...
 
virtual void SetParamString (int nPosition, const wxString &strValue)
 Set the parameter at the 1-based position to a wxString value. More...
 
virtual void SetParamNull (int nPosition)
 Set the parameter at the 1-based position to a NULL value. More...
 
virtual void SetParamBlob (int nPosition, const void *pData, long nDataLength)
 Set the parameter at the 1-based position to a Blob value. More...
 
virtual void SetParamDate (int nPosition, const wxDateTime &dateValue)
 Set the parameter at the 1-based position to a wxDateTime value. More...
 
virtual void SetParamBool (int nPosition, bool bValue)
 Set the parameter at the 1-based position to a boolean value. More...
 
virtual int GetParameterCount ()
 
virtual int RunQuery ()
 Run an insert, update, or delete query on the database. More...
 
virtual wxDatabaseResultSetRunQueryWithResults ()
 Run an insert, update, or delete query on the database. More...
 
virtual wxDatabaseResultSetRunQueryWithResults (bool bLogForCleanup)
 
SQLHSTMT GetLastStatement ()
 
void SetOneTimer (bool bOneTimer=true)
 
- Public Member Functions inherited from wxPreparedStatement
 wxPreparedStatement ()
 Constructor. More...
 
virtual ~wxPreparedStatement ()
 Destructor. More...
 
virtual void SetParamBlob (int nPosition, const wxMemoryBuffer &buffer)
 Set the parameter at the 1-based position to a Blob value. 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)
 

Private Member Functions

void InterpretErrorCodes (long nCode, SQLHSTMT stmth_ptr=NULL)
 
void FreeParameters ()
 
void BindParameters ()
 
void SetParam (int nPosition, wxOdbcParameter *pParameter)
 
int FindStatementAndAdjustPositionIndex (int *pPosition)
 

Private Attributes

bool m_bOneTimeStatement
 
SQLHENV m_sqlEnvHandle
 
SQLHDBC m_sqlHDBC
 
wxOdbcStatementVector m_Statements
 
ArrayOfOdbcParameters m_Parameters
 
wxOdbcInterfacem_pInterface
 

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)
 
- Protected Member Functions inherited from wxPreparedStatement
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 ()
 

Constructor & Destructor Documentation

◆ wxOdbcPreparedStatement() [1/3]

wxOdbcPreparedStatement::wxOdbcPreparedStatement ( wxOdbcInterface pInterface,
SQLHENV  sqlEnvHandle,
SQLHDBC  sqlHDBC 
)

◆ wxOdbcPreparedStatement() [2/3]

wxOdbcPreparedStatement::wxOdbcPreparedStatement ( wxOdbcInterface pInterface,
SQLHENV  sqlEnvHandle,
SQLHDBC  sqlHDBC,
SQLHSTMT  sqlStatementHandle 
)

◆ wxOdbcPreparedStatement() [3/3]

wxOdbcPreparedStatement::wxOdbcPreparedStatement ( wxOdbcInterface pInterface,
SQLHENV  sqlEnvHandle,
SQLHDBC  sqlHDBC,
wxOdbcStatementVector  statements 
)

◆ ~wxOdbcPreparedStatement()

virtual wxOdbcPreparedStatement::~wxOdbcPreparedStatement ( )
virtual

Member Function Documentation

◆ AddPreparedStatement()

void wxOdbcPreparedStatement::AddPreparedStatement ( SQLHSTMT  pStatement)

◆ BindParameters()

void wxOdbcPreparedStatement::BindParameters ( )
private

◆ Close()

virtual void wxOdbcPreparedStatement::Close ( )
virtual

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

Implements wxPreparedStatement.

◆ FindStatementAndAdjustPositionIndex()

int wxOdbcPreparedStatement::FindStatementAndAdjustPositionIndex ( int *  pPosition)
private

◆ FreeParameters()

void wxOdbcPreparedStatement::FreeParameters ( )
private

◆ GetLastStatement()

SQLHSTMT wxOdbcPreparedStatement::GetLastStatement ( )
inline

Definition at line 40 of file odbc_preparedstatement.h.

References m_Statements.

◆ GetParameterCount()

virtual int wxOdbcPreparedStatement::GetParameterCount ( )
virtual

Implements wxPreparedStatement.

◆ InterpretErrorCodes()

void wxOdbcPreparedStatement::InterpretErrorCodes ( long  nCode,
SQLHSTMT  stmth_ptr = NULL 
)
private

◆ RunQuery()

virtual int wxOdbcPreparedStatement::RunQuery ( )
virtual

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

Implements wxPreparedStatement.

◆ RunQueryWithResults() [1/2]

virtual wxDatabaseResultSet* wxOdbcPreparedStatement::RunQueryWithResults ( )
virtual

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

Implements wxPreparedStatement.

◆ RunQueryWithResults() [2/2]

virtual wxDatabaseResultSet* wxOdbcPreparedStatement::RunQueryWithResults ( bool  bLogForCleanup)
virtual

◆ SetOneTimer()

void wxOdbcPreparedStatement::SetOneTimer ( bool  bOneTimer = true)
inline

Definition at line 41 of file odbc_preparedstatement.h.

References m_bOneTimeStatement.

◆ SetParam()

void wxOdbcPreparedStatement::SetParam ( int  nPosition,
wxOdbcParameter pParameter 
)
private

◆ SetParamBlob()

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

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

Implements wxPreparedStatement.

◆ SetParamBool()

virtual void wxOdbcPreparedStatement::SetParamBool ( int  nPosition,
bool  bValue 
)
virtual

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

Implements wxPreparedStatement.

◆ SetParamDate()

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

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

Implements wxPreparedStatement.

◆ SetParamDouble()

virtual void wxOdbcPreparedStatement::SetParamDouble ( int  nPosition,
double  dblValue 
)
virtual

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

Implements wxPreparedStatement.

◆ SetParamInt()

virtual void wxOdbcPreparedStatement::SetParamInt ( int  nPosition,
int  nValue 
)
virtual

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

Implements wxPreparedStatement.

◆ SetParamNull()

virtual void wxOdbcPreparedStatement::SetParamNull ( int  nPosition)
virtual

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

Implements wxPreparedStatement.

◆ SetParamString()

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

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

Implements wxPreparedStatement.

Member Data Documentation

◆ m_bOneTimeStatement

bool wxOdbcPreparedStatement::m_bOneTimeStatement
private

Definition at line 52 of file odbc_preparedstatement.h.

Referenced by SetOneTimer().

◆ m_Parameters

ArrayOfOdbcParameters wxOdbcPreparedStatement::m_Parameters
private

Definition at line 57 of file odbc_preparedstatement.h.

◆ m_pInterface

wxOdbcInterface* wxOdbcPreparedStatement::m_pInterface
private

Definition at line 58 of file odbc_preparedstatement.h.

◆ m_sqlEnvHandle

SQLHENV wxOdbcPreparedStatement::m_sqlEnvHandle
private

Definition at line 53 of file odbc_preparedstatement.h.

◆ m_sqlHDBC

SQLHDBC wxOdbcPreparedStatement::m_sqlHDBC
private

Definition at line 54 of file odbc_preparedstatement.h.

◆ m_Statements

wxOdbcStatementVector wxOdbcPreparedStatement::m_Statements
private

Definition at line 55 of file odbc_preparedstatement.h.

Referenced by GetLastStatement().