#include <cursorImpl.h>
Public Member Functions | |
virtual void | open ()=0 |
Opens the cursor. | |
virtual void | close ()=0 |
Closes the cursor. | |
virtual void | prepare ()=0 |
Prepares the SQL statement for execution. | |
virtual void | preExecBind (const int pos, const void *varAddr, unsigned int size, const Type &varType, bool setNull, const MetadataHolder &attributes=MetadataHolder::emptyMeta)=0 |
Binds an input parameter to a place in the prepared statement. | |
virtual void | execute ()=0 |
Executes the statement. | |
virtual void | preFetchBind (const int pos, const void *varAddr, unsigned int size, const Type &varType, bool *isNull=NULL, const MetadataHolder &attributes=MetadataHolder::emptyMeta)=0 |
Binds an output parameter to a place in the result set. | |
virtual bool | fetchNext ()=0 |
Fetches next result from the result set. | |
virtual bool | fetchPrev ()=0 |
Fetches previous result from the result set. | |
virtual long | getPosition ()=0 |
Returns current position in the result set. |
Each database driver must provide a class that implements this interface
Instances of this class are obtained using the ConnectionImpl::getCursor method and are returned using the ConnectionImpl::returnCursor() method.
CursorImpl implementation is responsible for SQL statement execution, parameter binding and query results retrieval.
Cursor executes operations of this interface in the following order:
virtual void iopc::CursorImpl::open | ( | ) | [pure virtual] |
Opens the cursor.
Implementation should allocate all resources needed for the SQL statement execution
virtual void iopc::CursorImpl::close | ( | ) | [pure virtual] |
Closes the cursor.
Implementation should release all resources allocated in the CursorImpl::open() method
virtual void iopc::CursorImpl::preExecBind | ( | const int | pos, | |
const void * | varAddr, | |||
unsigned int | size, | |||
const Type & | varType, | |||
bool | setNull, | |||
const MetadataHolder & | attributes = MetadataHolder::emptyMeta | |||
) | [pure virtual] |
Binds an input parameter to a place in the prepared statement.
pos | Position of the parameter in the prepared statement | |
varAddr | Address of the parameter value to be bound | |
size | Memory size of the parameter in bytes | |
varType | Data type of the parameter. varType refers only to basic datatypes (IOPC_TYPECLASS_SIMPLE) or to string datatypes (IOPC_TYPECLASS_STRING). If the IOPC_TYPECLASS_STRING type is specified, the varAddr refers to standard zero-terminaded C string representation. | |
setNull | Indicates, that instead the parameter should be a database NULL value. In this case, the varAddr pointer may be NULL. | |
attributes | Additional driver dependent parameters. |
virtual void iopc::CursorImpl::preFetchBind | ( | const int | pos, | |
const void * | varAddr, | |||
unsigned int | size, | |||
const Type & | varType, | |||
bool * | isNull = NULL , |
|||
const MetadataHolder & | attributes = MetadataHolder::emptyMeta | |||
) | [pure virtual] |
Binds an output parameter to a place in the result set.
pos | Position of the parameter in the result set | |
varAddr | Address of the output buffer where the fetched value will be stored. | |
size | Buffer size allocated to hold the fetched value in bytes | |
varType | Data type of the parameter. varType refers only to basic datatypes (IOPC_TYPECLASS_SIMPLE) or to string datatypes (IOPC_TYPECLASS_STRING). | |
isNull | Pointer to an indicator variable which will be set to true if the fetched value is database NULL. A NULL pointer may be passed to ignore the database NULL value notifiaction. | |
attributes | Additional driver dependent parameters. |
virtual bool iopc::CursorImpl::fetchNext | ( | ) | [pure virtual] |
Fetches next result from the result set.
Output parameters and NULL indicators specified in CursorImpl::preFetchBind are updated.
virtual bool iopc::CursorImpl::fetchPrev | ( | ) | [pure virtual] |
Fetches previous result from the result set.
Output parameters and NULL indicators specified in CursorImpl::preFetchBind are updated.
IopcNotSupportedException | if this operation is not supported by the database driver. |