Derived ODBCDatabase class to implement specific operations for ODBC Databases. More...
#include <ODBCDatabase.h>
Public Member Functions | |
ODBCDatabase () | |
virtual | ~ODBCDatabase () |
virtual void | BeginTransaction (const bool readonly) |
Starts a transaction. More... | |
virtual void | EndTransaction (const TransactionType::TRANSACTION_TYPE transactionType, const bool throwOnError) |
Ends a transaction. More... | |
void | Connect (const ConnectionString &connectionString) |
Connects using the given connection string. More... | |
void | Disconnect () |
Disconnects and release connection resources. More... | |
virtual bool | IsConnected () |
Query if Database instance is connected. More... | |
void | ExecuteNonQuery (const DataCommand::COMMAND_TYPE commType, const string &stringStatement, bool onCursor) |
Execute NonQuery SQL statements or stored procedures ( without params ) More... | |
void | ExecuteNonQueryCached (const DataCommand::COMMAND_TYPE commType, const string &stringStatement, bool onCursor) |
Execute NonQueryCached SQL statements or stored procedures ( without params ) and use caching. More... | |
void | ExecuteNonQuery (const DataCommand::COMMAND_TYPE commType, const string &stringStatement, const ParametersVector &vectorOfParameters, bool onCursor) |
Execute NonQuery SQL statements or stored procedures ( with params ) More... | |
void | ExecuteNonQueryCached (const DataCommand::COMMAND_TYPE commType, const string &stringStatement, const ParametersVector &vectorOfParameters, bool onCursor) |
Execute NonQueryCached SQL statements or stored procedures ( with params ) and use caching. More... | |
DataSet * | ExecuteQuery (const DataCommand::COMMAND_TYPE commType, const string &stringStatement, bool onCursor, const unsigned int fetchRows) |
Execute Query SQL statements ( without params ) More... | |
DataSet * | ExecuteQuery (const DataCommand::COMMAND_TYPE commType, const string &stringStatement, const ParametersVector &vectorOfParameters, bool onCursor, const unsigned int fetchRows) |
Execute Query SQL statements ( with params ) More... | |
DataSet * | ExecuteQueryCached (const DataCommand::COMMAND_TYPE commType, const string &stringStatement, const bool onCursor, const unsigned int fetchRows) |
Query SQL statements ( without params ) and use caching More... | |
DataSet * | ExecuteQueryCached (const DataCommand::COMMAND_TYPE commType, const string &stringStatement, const ParametersVector &vectorOfParameters, const bool onCursor, const unsigned int fetchRows) |
Execute Query SQL statements ( with params ) and use caching. More... | |
void | ReleaseCursor (const bool checkConn) |
If onCursor=true is passed to ExecuteQuery methods, a client is required to use these methods to release cursor resources. More... | |
void | RewindCursor () |
Rewind cursor to the first position. More... | |
bool | CursorHeld () const |
Determines if we can hold the cursor. More... | |
Public Member Functions inherited from FinTP::Database | |
Database () | |
virtual | ~Database () |
void | BeginTransaction () |
void | EndTransaction (const TransactionType::TRANSACTION_TYPE transactionType) |
void | ExecuteNonQuery (const DataCommand::COMMAND_TYPE commandType, const string &stringStatement) |
void | ExecuteNonQueryCached (const DataCommand::COMMAND_TYPE commandType, const string &stringStatement) |
void | ExecuteNonQuery (const DataCommand::COMMAND_TYPE commandType, const string &stringStatement, const ParametersVector &vectorOfParameters) |
void | ExecuteNonQueryCached (const DataCommand::COMMAND_TYPE commandType, const string &stringStatement, const ParametersVector &vectorOfParameters) |
DataSet * | ExecuteQuery (const DataCommand::COMMAND_TYPE commandType, const string &stringStatement, bool holdCursor) |
DataSet * | ExecuteQuery (const DataCommand::COMMAND_TYPE commandType, const string &stringStatement) |
DataSet * | ExecuteQueryCached (const DataCommand::COMMAND_TYPE commandType, const string &stringStatement, bool holdCursor) |
DataSet * | ExecuteQueryCached (const DataCommand::COMMAND_TYPE commandType, const string &stringStatement) |
DataSet * | ExecuteQuery (const DataCommand::COMMAND_TYPE commandType, const string &stringStatement, const ParametersVector &vectorOfParameters, bool holdCursor) |
DataSet * | ExecuteQuery (const DataCommand::COMMAND_TYPE commandType, const string &stringStatement, const ParametersVector &vectorOfParameters) |
DataSet * | ExecuteQueryCached (const DataCommand::COMMAND_TYPE commandType, const string &stringStatement, const ParametersVector &vectorOfParameters, bool holdCursor) |
DataSet * | ExecuteQueryCached (const DataCommand::COMMAND_TYPE commandType, const string &stringStatement, const ParametersVector &vectorOfParameters) |
void | ReleaseCursor () |
int | getLastNumberofAffectedRows () const |
Protected Member Functions | |
bool | isEnvAllocated () const |
SQLRETURN | AllocateEnv () |
bool | isDbcAllocated () const |
void | BindParams (const ParametersVector &vectorOfParameters, SQLHANDLE *statementHandle=NULL, const unsigned int startIndex=1) |
DataSet * | innerExecuteCommand (const DataCommand &command, const ParametersVector &vectorOfParameters, const bool useCursor=false, const unsigned int fetchRows=0) |
DataSet * | executeQuery (DataCommand &command, const bool isCommandCached, SQLHANDLE *statementHandle, const bool useCursor, const unsigned int fetchRows=0) |
DataSet * | getDataSet (DataCommand &command, const bool isCommandCached, SQLHANDLE *statementHandle, const bool useCursor, const unsigned int fetchRows=0) |
void | executeNonQuery (DataCommand &command, const bool isCommandCached, SQLHANDLE *statementHandle, const bool useCursor) |
virtual string | getErrorInformation (SQLSMALLINT htype, SQLHANDLE handle) |
virtual void | setSpecificConnAttr () |
virtual void | setSpecificEnvAttr () |
virtual string | callFormating (const string &statementString, const ParametersVector &vectorOfParameters) |
Static Protected Member Functions | |
static int | getODBCTransactionType (TransactionType::TRANSACTION_TYPE type) |
Protected Attributes | |
SQLHANDLE | m_Henv |
bool | m_HenvAllocated |
bool | m_IsConnected |
SQLHANDLE | m_Hdbc |
bool | m_HdbcAllocated |
SQLHANDLE | m_Hstmt |
SQLHANDLE | m_HoldCursorHandle |
string | m_HoldCursorName |
bool | m_HoldCursorInvoked |
Protected Attributes inherited from FinTP::Database | |
CacheManager< string, DataCommand > | m_StatementCache |
Collection to hold already executed Command instances. More... | |
string | m_LastErrorCode |
The last error code returned from command execution. More... | |
unsigned int | m_LastNumberofAffectedRows |
The number of updates last command performed. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from FinTP::Database | |
static void | DisplayDataSet (const DataSet *theDataSet) |
Utility method used to pretty print DataSet objects. More... | |
static XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument * | ConvertToXML (const DataSet *theDataSet, const bool doTrimm=true) |
Utility method that converts DataSet parameter objects to following XML format: <TableName> <Record> <Column_Name_n>Column_Value_n<Column_Name_n> </Record> </TableName> More... | |
Static Public Attributes inherited from FinTP::Database | |
static string | DateFormat = "DD.MM.YYYY" |
Used to convert a date/timestamp column to a string format database specific formats. More... | |
static string | TimestampFormat = "DD.MM.YYYY HH:MI" |
Derived ODBCDatabase class to implement specific operations for ODBC Databases.
Database declare two types of "ExecuteQuery" methods
Database, define four library specific exception types to be used by its implementations
ODBCDatabase::ODBCDatabase | ( | ) |
|
virtual |
|
protected |
|
virtual |
Starts a transaction.
readonly | = true if no Inserts/Updates are intended |
Implements FinTP::Database.
Reimplemented in FinTP::InformixDatabase, and FinTP::SqlServerDatabase.
|
protected |
|
protectedvirtual |
Reimplemented in FinTP::InformixDatabase, FinTP::SqlServerDatabase, and FinTP::PostgresDatabase.
|
virtual |
Connects using the given connection string.
connectionString. | Connection information nedeed to connect to DBMS. |
Implements FinTP::Database.
|
inlinevirtual |
Determines if we can hold the cursor.
Reimplemented from FinTP::Database.
|
virtual |
Disconnects and release connection resources.
Implements FinTP::Database.
|
virtual |
Ends a transaction.
transactionType | TransactionType option to close transaction |
throwOnError | Bool flag to inhibit exception throwing on error. |
Implements FinTP::Database.
Reimplemented in FinTP::InformixDatabase, and FinTP::SqlServerDatabase.
|
inlinevirtual |
Execute NonQuery SQL statements or stored procedures ( without params )
commType | type COMMAND_TYPE. The command type. |
stringStatement | type string. The statement. |
onCursor | type bool. Determine if the function will use an Oracle cursor to iterate through the results. |
Implements FinTP::Database.
|
inlinevirtual |
Execute NonQuery SQL statements or stored procedures ( with params )
commType | type COMMAND_TYPE. The command type . |
stringStatement | type string. The statement. |
vectorOfParameters | type ParametersVector. The vector of parameters. Used when multiple parameters are needed. |
onCursor | type bool. Determine if the function will use an Oracle cursor to iterate through the results. |
Implements FinTP::Database.
|
protected |
|
inlinevirtual |
Execute NonQueryCached SQL statements or stored procedures ( without params ) and use caching.
commType | type COMMAND_TYPE. The command type |
stringStatement | type string. The statement. |
onCursor | type bool. Determine if the function will use an Oracle cursor to iterate through the results. |
Implements FinTP::Database.
|
inlinevirtual |
Execute NonQueryCached SQL statements or stored procedures ( with params ) and use caching.
commType | type COMMAND_TYPE. The command type. |
stringStatement | type string. The statement. |
vectorOfParameters | type ParametersVector. The vector of parameters. Used when multiple parameters are needed. |
onCursor | type bool. Determine if the function will use an Oracle cursor to iterate through the results. |
Implements FinTP::Database.
|
inlinevirtual |
Execute Query SQL statements ( without params )
commType | type COMMAND_TYPE. The command type. |
stringStatement | type string. The statement. |
onCursor | type bool. Determine if the function will use an Oracle cursor to iterate through the results. |
fetchRows | type int. The row number used in where clause. |
Implements FinTP::Database.
Reimplemented in FinTP::PostgresDatabase.
|
inlinevirtual |
Execute Query SQL statements ( with params )
commType | type COMMAND_TYPE. The command type. |
stringStatement | type string. The statement. |
vectorOfParameters | type ParametersVector. The vector of parameters. Used when multiple parameters are needed. |
onCursor | type bool. Determine if the function will use a cursor to iterate through the results. |
fetchRows | type int. The row number used in where clause. |
Implements FinTP::Database.
Reimplemented in FinTP::PostgresDatabase.
|
protected |
|
inlinevirtual |
Query SQL statements ( without params ) and use caching
commType | type COMMAND_TYPE. The command type. |
stringStatement | type string. The statement. |
onCursor | type bool. Determine if the function will use a cursor to iterate through the results. |
fetchRows | type int. The row number used in where clause. |
Implements FinTP::Database.
Reimplemented in FinTP::PostgresDatabase.
|
inlinevirtual |
Execute Query SQL statements ( with params ) and use caching.
commType | type COMMAND_TYPE. The command type. |
stringStatement | type string. The statement. |
vectorOfParameters | type ParametersVector. The vector of parameters. Used when multiple parameters are needed. |
onCursor | type bool. Determine if the function will use a cursor to iterate through the results. |
fetchRows | type int. The row number used in where clause. |
Implements FinTP::Database.
Reimplemented in FinTP::PostgresDatabase.
|
protected |
|
protectedvirtual |
Reimplemented in FinTP::InformixDatabase.
|
staticprotected |
|
protected |
|
inlinevirtual |
Query if Database instance is connected.
Implements FinTP::Database.
Reimplemented in FinTP::InformixDatabase.
|
inlineprotected |
|
inlineprotected |
|
virtual |
If onCursor=true is passed to ExecuteQuery methods, a client is required to use these methods to release cursor resources.
checkConn | true to check connection. |
Implements FinTP::Database.
|
virtual |
Rewind cursor to the first position.
Implements FinTP::Database.
|
inlineprotectedvirtual |
Reimplemented in FinTP::SqlServerDatabase, and FinTP::Db2Database.
|
protectedvirtual |
Reimplemented in FinTP::InformixDatabase, and FinTP::SqlServerDatabase.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |