58 long GetScalar(
const std::wstring& query)
const;
61 std::wstring
GetXml(
const std::wstring& query)
const;
71 std::string
GetString(
const std::wstring& query, WORD flags = 0)
const;
75 std::wstring
GetWString(
const std::wstring& query, WORD flags = 0)
const;
79 void Execute(
const std::wstring& query)
const;
Definition: Connection.h:16
void Terminate()
terminate the ODBC environment, succeeds if Initialize has not been called
Definition: Connection.cpp:47
SQLHDBC _hconnection
ODBC connection handle.
Definition: Connection.h:31
ODBCConnection()
Definition: Connection.cpp:8
long GetScalar(const std::wstring &query) const
Return a scalar result from a query (eg. a count)
Definition: Connection.cpp:106
void Initialize()
initialize the ODBC environment at ODBC version 3.0, fails if previously initialized ...
Definition: Connection.cpp:29
BOOL IsConnected() const
returns true if connected
Definition: Connection.h:54
std::string GetString(const std::wstring &query, WORD flags=0) const
Return a string result from a query.
Definition: Connection.cpp:130
Definition: Connection.h:13
std::vector< ODBCError > GetErrors() const
get an array of errors on the current ODBC handle
Definition: Handle.h:65
std::wstring GetError() const
get the text representation of the errors on an ODBC handle
Definition: Handle.h:63
Definition: Connection.h:15
std::wstring GetXml(const std::wstring &query) const
Return the data set from a query in xml format.
Definition: Connection.cpp:301
An ODBC rowset.
Definition: RowSet.h:10
std::vector< ODBCError > GetErrors() const
get an array of errors on the current ODBC connection
Definition: Connection.h:50
A generic connection info.
Definition: ConnectionInfo.h:10
An ODBC handle (smart pointer), bound to a connection.
Definition: Handle.h:31
An MSXML document.
Definition: XmlDocument.h:8
Definition: Connection.h:11
Definition: Connection.h:17
virtual ~ODBCConnection()
Definition: Connection.cpp:16
Definition: Connection.h:18
void InsertXml(const AppSecInc::Xml::XmlDocument &xmldatadoc)
Insert data from xml.
Definition: Connection.cpp:352
Definition: Connection.h:12
void Execute(const std::wstring &query) const
Execute a statement.
Definition: Connection.cpp:227
BOOL _connected
successful initialization and connection flag
Definition: Connection.h:35
SQLHENV _henvironment
ODBC environment.
Definition: Connection.h:33
SQLHENV GetEnvironmentHandle() const
returns the environment handle
Definition: Connection.h:56
An ODBC parameters.
Definition: Parameters.h:10
Definition: Connection.h:14
const WORD ODBC_SQL_FLAG_NO_ROWS_RETURN_EMPTY
In GetString don't consider empty rowset as error, return empty string instead.
Definition: Connection.h:23
An ODBC connection.
Definition: Connection.h:27
void Connect(const ODBCConnectionInfo &connection_info)
connect to a host, fails if already connected
Definition: Connection.cpp:62
std::wstring GetWString(const std::wstring &query, WORD flags=0) const
Return a string result from a query.
Definition: Connection.cpp:174
ODBCConnectionProtocol
Definition: Connection.h:9
void Disconnect()
disconnect from a host, fails if not connected
Definition: Connection.cpp:96
std::wstring GetError() const
get the text representation of the errors on an ODBC connection handle
Definition: Connection.h:48