Parameter.h
Go to the documentation of this file.
1 #pragma once
2 
3 namespace AppSecInc
4 {
5  namespace Databases
6  {
7  namespace ODBC
8  {
10  class ODBCParameter : public ODBCBuffer
11  {
12  private:
14  SQLSMALLINT _iotype;
16  SQLSMALLINT _parametertype;
18  std::wstring _name;
19  public:
20  void operator=(const ODBCParameter&);
22  SQLSMALLINT GetIOType() const { return _iotype; }
24  SQLSMALLINT GetParameterType() const { return _parametertype; }
26  const std::wstring& GetName() const { return _name; }
28  void BindAt(SQLHANDLE hstmt, SQLHDESC hipd, int index);
30  ODBCParameter(const ODBCParameter& parameter);
31  ODBCParameter(const std::wstring& name, SQLSMALLINT iotype, SQLSMALLINT valuetype, SQLSMALLINT parametertype, SQLINTEGER datasize);
32  ODBCParameter(const std::wstring& name, const std::wstring& value, SQLSMALLINT iotype = SQL_PARAM_INPUT);
33  ODBCParameter(const std::wstring& name, const std::string& value, SQLSMALLINT iotype = SQL_PARAM_INPUT);
34  ODBCParameter(const std::wstring& name, const SYSTEMTIME& value, SQLSMALLINT iotype = SQL_PARAM_INPUT);
35  ODBCParameter(const std::wstring& name, const GUID& value, SQLSMALLINT iotype = SQL_PARAM_INPUT);
36  ODBCParameter(const std::wstring& name, bool value, SQLSMALLINT iotype = SQL_PARAM_INPUT);
37  ODBCParameter(const std::wstring& name, char value, SQLSMALLINT iotype = SQL_PARAM_INPUT);
38  ODBCParameter(const std::wstring& name, wchar_t value, SQLSMALLINT iotype = SQL_PARAM_INPUT);
39  ODBCParameter(const std::wstring& name, int value, SQLSMALLINT iotype = SQL_PARAM_INPUT);
40  ODBCParameter(const std::wstring& name, short value, SQLSMALLINT iotype = SQL_PARAM_INPUT);
41  ODBCParameter(const std::wstring& name, float value, SQLSMALLINT iotype = SQL_PARAM_INPUT);
42  ODBCParameter(const std::wstring& name, double value, SQLSMALLINT iotype = SQL_PARAM_INPUT);
44  static ODBCParameter Create(const std::wstring name, const std::wstring& value, SQLSMALLINT sqltype, SQLSMALLINT iotype = SQL_PARAM_INPUT);
45  virtual ~ODBCParameter();
46  };
47  }
48  }
49 }
50 
51 
void operator=(const ODBCParameter &)
Definition: Parameter.cpp:159
virtual ~ODBCParameter()
Definition: Parameter.cpp:167
void BindAt(SQLHANDLE hstmt, SQLHDESC hipd, int index)
bind the parameter to a statement at a given index
Definition: Parameter.cpp:172
const std::wstring & GetName() const
get the name of the parameter
Definition: Parameter.h:26
SQLSMALLINT GetParameterType() const
the SQL data type of the parameter, eg. SQL_INTEGER
Definition: Parameter.h:24
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
Definition: Parameter.cpp:189
An ODBC column.
Definition: Parameter.h:10
ODBCParameter(const ODBCParameter &parameter)
constructors
Definition: Parameter.cpp:152
SQLSMALLINT GetIOType() const
i/o type, eg. SQL_PARAM_INPUT
Definition: Parameter.h:22
An ODBC column.
Definition: Buffer.h:10


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