Public Member Functions | Static Public Member Functions | List of all members
AppSecInc::Databases::ODBC::ODBCParameter Class Reference

An ODBC column. More...

#include <Parameter.h>

Inheritance diagram for AppSecInc::Databases::ODBC::ODBCParameter:
AppSecInc::Databases::ODBC::ODBCBuffer

Public Member Functions

void operator= (const ODBCParameter &)
 
SQLSMALLINT GetIOType () const
 i/o type, eg. SQL_PARAM_INPUT More...
 
SQLSMALLINT GetParameterType () const
 the SQL data type of the parameter, eg. SQL_INTEGER More...
 
const std::wstring & GetName () const
 get the name of the parameter More...
 
void BindAt (SQLHANDLE hstmt, SQLHDESC hipd, int index)
 bind the parameter to a statement at a given index More...
 
 ODBCParameter (const ODBCParameter &parameter)
 constructors More...
 
 ODBCParameter (const std::wstring &name, SQLSMALLINT iotype, SQLSMALLINT valuetype, SQLSMALLINT parametertype, SQLINTEGER datasize)
 
 ODBCParameter (const std::wstring &name, const std::wstring &value, SQLSMALLINT iotype=SQL_PARAM_INPUT)
 
 ODBCParameter (const std::wstring &name, const std::string &value, SQLSMALLINT iotype=SQL_PARAM_INPUT)
 
 ODBCParameter (const std::wstring &name, const SYSTEMTIME &value, SQLSMALLINT iotype=SQL_PARAM_INPUT)
 
 ODBCParameter (const std::wstring &name, const GUID &value, SQLSMALLINT iotype=SQL_PARAM_INPUT)
 
 ODBCParameter (const std::wstring &name, bool value, SQLSMALLINT iotype=SQL_PARAM_INPUT)
 
 ODBCParameter (const std::wstring &name, char value, SQLSMALLINT iotype=SQL_PARAM_INPUT)
 
 ODBCParameter (const std::wstring &name, wchar_t value, SQLSMALLINT iotype=SQL_PARAM_INPUT)
 
 ODBCParameter (const std::wstring &name, int value, SQLSMALLINT iotype=SQL_PARAM_INPUT)
 
 ODBCParameter (const std::wstring &name, short value, SQLSMALLINT iotype=SQL_PARAM_INPUT)
 
 ODBCParameter (const std::wstring &name, float value, SQLSMALLINT iotype=SQL_PARAM_INPUT)
 
 ODBCParameter (const std::wstring &name, double value, SQLSMALLINT iotype=SQL_PARAM_INPUT)
 
virtual ~ODBCParameter ()
 
- Public Member Functions inherited from AppSecInc::Databases::ODBC::ODBCBuffer
virtual void operator= (const ODBCBuffer &)
 copy operator, data will be copied More...
 
SQLINTEGER GetDataSize () const
 get the size of the data More...
 
int GetBufferSize () const
 get the size of the buffer More...
 
SQLSMALLINT GetType () const
 get the type of data More...
 
 ODBCBuffer ()
 constructors More...
 
 ODBCBuffer (SQLSMALLINT type, SQLINTEGER size)
 
 ODBCBuffer (const std::wstring &value)
 
 ODBCBuffer (const std::string &value)
 
 ODBCBuffer (const SYSTEMTIME &value)
 
 ODBCBuffer (const GUID &value)
 
 ODBCBuffer (bool value)
 
 ODBCBuffer (int value)
 
 ODBCBuffer (char value)
 
 ODBCBuffer (wchar_t value)
 
 ODBCBuffer (short value)
 
 ODBCBuffer (double value)
 
 ODBCBuffer (float value)
 
 ODBCBuffer (const ODBCBuffer &Buffer)
 
virtual ~ODBCBuffer ()
 
std::string ToString () const
 convert the value to a string regardless of its internal type More...
 
std::wstring ToWString () const
 convert the value to a unicode string regardless of its internal type More...
 
std::string GetStringValue () const
 get the data as a null-terminated string, disregarding fetched data size More...
 
std::wstring GetWStringValue () const
 get the data as a null-terminated unicode string, disregarding fetched data size More...
 
const std::vector< char > & GetValue () const
 get the raw data buffer More...
 
int GetIntValue () const
 get a value of type integer (SQL_INTEGER, SQL_DECIMAL, etc.) More...
 
int GetShortValue () const
 get a value of type short (SQL_SMALLINT) More...
 
bool GetBoolValue () const
 get a value of type bool (SQL_BIT) More...
 
LONGLONG GetLongLongValue () const
 get a value of type longlong (SQL_BIGINT, etc.) More...
 
GUID GetGUIDValue () const
 get a value of type uniqueidentifier More...
 
double GetDoubleValue () const
 get a value of type double More...
 
float GetFloatValue () const
 get the value of type float More...
 
char GetCharValue () const
 get a single character value More...
 
wchar_t GetVarCharValue () const
 get a single unicode character value More...
 
DATE_STRUCT GetDate () const
 get a date structure More...
 
TIME_STRUCT GetTime () const
 get a time structure More...
 
TIMESTAMP_STRUCT GetTimeStamp () const
 get a timestamp structure More...
 

Static Public Member Functions

static ODBCParameter Create (const std::wstring name, const std::wstring &value, SQLSMALLINT sqltype, SQLSMALLINT iotype=SQL_PARAM_INPUT)
 convert a string value into an ODBC parameter More...
 
- Static Public Member Functions inherited from AppSecInc::Databases::ODBC::ODBCBuffer
static std::wstring SQLTypeToString (SQLSMALLINT type)
 translate a SQL type to its string representation More...
 
static SQLSMALLINT StringToSQLType (const std::wstring &type)
 translate a string to its SQL type More...
 

Additional Inherited Members

- Static Public Attributes inherited from AppSecInc::Databases::ODBC::ODBCBuffer
static const SQLINTEGER INVALID_SIZE = 0
 invalid data size More...
 
- Static Protected Member Functions inherited from AppSecInc::Databases::ODBC::ODBCBuffer
static SQLINTEGER GetSize (SQLSMALLINT type)
 returns the size for default types, zero otherwise More...
 
- Protected Attributes inherited from AppSecInc::Databases::ODBC::ODBCBuffer
SQLSMALLINT _type
 column type, eg. SQL_C_CHAR More...
 
SQLINTEGER _size
 the data size after a Fetch More...
 
std::vector< char > _buffer
 the data buffer More...
 

Detailed Description

An ODBC column.

Constructor & Destructor Documentation

ODBCParameter::ODBCParameter ( const ODBCParameter parameter)

constructors

ODBCParameter::ODBCParameter ( const std::wstring &  name,
SQLSMALLINT  iotype,
SQLSMALLINT  valuetype,
SQLSMALLINT  parametertype,
SQLINTEGER  datasize 
)
ODBCParameter::ODBCParameter ( const std::wstring &  name,
const std::wstring &  value,
SQLSMALLINT  iotype = SQL_PARAM_INPUT 
)
ODBCParameter::ODBCParameter ( const std::wstring &  name,
const std::string &  value,
SQLSMALLINT  iotype = SQL_PARAM_INPUT 
)
ODBCParameter::ODBCParameter ( const std::wstring &  name,
const SYSTEMTIME &  value,
SQLSMALLINT  iotype = SQL_PARAM_INPUT 
)
ODBCParameter::ODBCParameter ( const std::wstring &  name,
const GUID &  value,
SQLSMALLINT  iotype = SQL_PARAM_INPUT 
)
ODBCParameter::ODBCParameter ( const std::wstring &  name,
bool  value,
SQLSMALLINT  iotype = SQL_PARAM_INPUT 
)
ODBCParameter::ODBCParameter ( const std::wstring &  name,
char  value,
SQLSMALLINT  iotype = SQL_PARAM_INPUT 
)
ODBCParameter::ODBCParameter ( const std::wstring &  name,
wchar_t  value,
SQLSMALLINT  iotype = SQL_PARAM_INPUT 
)
ODBCParameter::ODBCParameter ( const std::wstring &  name,
int  value,
SQLSMALLINT  iotype = SQL_PARAM_INPUT 
)
ODBCParameter::ODBCParameter ( const std::wstring &  name,
short  value,
SQLSMALLINT  iotype = SQL_PARAM_INPUT 
)
ODBCParameter::ODBCParameter ( const std::wstring &  name,
float  value,
SQLSMALLINT  iotype = SQL_PARAM_INPUT 
)
ODBCParameter::ODBCParameter ( const std::wstring &  name,
double  value,
SQLSMALLINT  iotype = SQL_PARAM_INPUT 
)
ODBCParameter::~ODBCParameter ( )
virtual

Member Function Documentation

void ODBCParameter::BindAt ( SQLHANDLE  hstmt,
SQLHDESC  hipd,
int  index 
)

bind the parameter to a statement at a given index

ODBCParameter ODBCParameter::Create ( const std::wstring  name,
const std::wstring &  value,
SQLSMALLINT  sqltype,
SQLSMALLINT  iotype = SQL_PARAM_INPUT 
)
static

convert a string value into an ODBC parameter

SQLSMALLINT AppSecInc::Databases::ODBC::ODBCParameter::GetIOType ( ) const
inline

i/o type, eg. SQL_PARAM_INPUT

const std::wstring& AppSecInc::Databases::ODBC::ODBCParameter::GetName ( ) const
inline

get the name of the parameter

SQLSMALLINT AppSecInc::Databases::ODBC::ODBCParameter::GetParameterType ( ) const
inline

the SQL data type of the parameter, eg. SQL_INTEGER

void ODBCParameter::operator= ( const ODBCParameter rhs)

The documentation for this class was generated from the following files:


© Application Security Inc. - All Rights Reserved http://msiext.codeplex.com