Derived OracleDatabase class to implement specific operations for Oracle Databases. More...
#include <OracleDatabase.h>
Public Member Functions | |
OracleDatabase () | |
~OracleDatabase () | |
void | BeginTransaction (const bool readonly) |
Oracle overrides for transaction support. More... | |
void | EndTransaction (const TransactionType::TRANSACTION_TYPE transactionType, const bool throwOnError) |
Ends a transaction. More... | |
void | Connect (const ConnectionString &connectionString) |
Connect to database. More... | |
void | Disconnect () |
Disconnect from database. More... | |
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 | ReleaseStatement (const bool isCommandCached, const string &key) |
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... | |
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 () |
virtual bool | CursorHeld () const |
Determines if we can hold the cursor. More... | |
int | getLastNumberofAffectedRows () const |
Private Member Functions | |
void | BindParams (const ParametersVector &vectorOfParameters, const unsigned int startIndex=1) |
Bind parameters. More... | |
DataSet * | innerExecuteCommand (const DataCommand &command, const ParametersVector &vectorOfParameters, const bool useCursor=false, const unsigned int fetchRows=0) |
DataSet * | executeQuery (DataCommand &command, const bool isCommandCached, const bool useCursor) |
fetches data from the database, using an already created statement handle. More... | |
DataSet * | getDataSet (DataCommand &command, const bool isCommandCached, OCIStmt *statementHandle, const bool useCursor) |
void | executeNonQuery (DataCommand &command, const bool isCommandCached, const bool useCursor) |
Executes the non query operation. More... | |
string | getErrorInformation (dvoid *errorHandle, sword status, ub4 handleType=OCI_HTYPE_ERROR, const bool connCheck=true) |
get detailed error information. More... | |
OCIType * | getMessageType (const string &typeName, const string &userName="") |
void | freeOCIArrays (const ParametersVector &vectorOfParameters) |
void | initXmlContext () |
string | RawToString (const OCIRaw *value) |
OCIRaw * | StringToRaw (const string &value) |
void | ClearDateTimestampBinds () |
Static Private Member Functions | |
static int | getOracleTransactionType (TransactionType::TRANSACTION_TYPE type) |
Private Attributes | |
bool | m_IsConnected |
bool | m_IsReconnecting |
ConnectionString | m_ConnectionString |
OCIEnv * | m_hEnv |
OCIError * | m_hError |
OCISvcCtx * | m_hServiceContext |
OCISession * | m_hSession |
OCIServer * | m_hServer |
OCITrans * | m_hTransaction |
OCIStmt * | m_StatementHandle |
OCIStmt * | m_hCursor |
OCIRowid * | m_HoldCursorRowId |
xmlctx * | m_XmlContext |
OCIClobLocator * | m_ClobLocator |
OCIBlobLocator * | m_BlobLocator |
OCIClobLocator * | m_FetchClobLocator |
OCIClobLocator * | m_FetchBlobLocator |
OCIType * | m_ArrayType |
vector< OCIDate ** > | m_Date |
vector< OCIDateTime ** > | m_Timestamp |
CacheManager< string, OCIType * > | m_TypeCache |
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" |
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... | |
Derived OracleDatabase class to implement specific operations for Oracle Databases.
Database declare two types of "ExecuteQuery" methods
Database, define four library specific exception types to be used by its implementations
OracleDatabase::OracleDatabase | ( | ) |
OracleDatabase::~OracleDatabase | ( | ) |
|
virtual |
|
private |
Bind parameters.
vectorOfParameters | Options for controlling the vector of parameters. |
startIndex | the start index. |
|
private |
|
virtual |
Connect to database.
connectionString | The connection string to connect. |
Implements FinTP::Database.
|
virtual |
Disconnect from database.
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.
|
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 throught the results. |
Implements FinTP::Database.
|
private |
Executes the non query operation.
[in,out] | command | The command. Can be nonquery or stored procedure. |
isCommandCached | Determines if the command is cached | |
useCursor | Determines if a cursor is going to be used. |
|
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 throught 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 throught 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 throught the results. |
fetchRows | type int. The row number used in where clause. |
Implements FinTP::Database.
|
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 an Oracle cursor to iterate throught the results. |
fetchRows | type int. The row number used in where clause. |
Implements FinTP::Database.
|
private |
fetches data from the database, using an already created statement handle.
[in,out] | command | The command. Can be query or stored procedure. |
isCommandCached | Determines if the command is cached. | |
useCursor | Determines if a cursor is going to be used. |
|
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 an Oracle cursor to iterate throught the results. |
fetchRows | type int. The row number used in where clause. |
Implements FinTP::Database.
|
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 an Oracle cursor to iterate throught the results. |
fetchRows | type int. The row number used in where clause. |
Releases the statement.
isCommandCached | The is command cached. |
key | The key associated with the statement in the cache. |
Implements FinTP::Database.
|
private |
|
private |
|
private |
get detailed error information.
[in,out] | errorHandle | If non-null, handle of the error. |
status | The status. | |
handleType | The type of the handle. | |
connCheck | The connection check. |
|
private |
|
staticprivate |
|
private |
|
private |
|
virtual |
Query if Database instance is connected.
Implements FinTP::Database.
|
private |
|
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.
void OracleDatabase::ReleaseStatement | ( | const bool | isCommandCached, |
const string & | key | ||
) |
|
inlinevirtual |
Rewind cursor to the first position.
Implements FinTP::Database.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |