| TerraLib 4.1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Examples

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Public Attributes | Protected Attributes
TeOCIConnection Class Reference

This class is used to connect to a ORACLE DBMS. More...

`#include <TeOCIConnect.h>`

List of all members.

## Public Member Functions

| TeOCIConnection ()
| Constructor.
| ~TeOCIConnection ()
| Destructor.
bool | connect (const char *dblink, const char *username, const char *password, const bool &useSDO=false)
| Connects to ORACLE DBMS.
void | disconnect ()
| Disconnects to ORACLE DBMS.
bool | prepare (const string &stmt)
| Prepares the SQL statement to be executed.
bool | bindByPos (int pos, void *value, int size, void *indicator, int type)
| Binds objects by position.
bool | bindByName (char *name, void *value, int size, void *indicator, int type)
| Binds objects by name.
bool | bindOrdinates ()
| Binds ordinate object.
bool | appendOrdinates (const double &val)
| Appends ordinates to be inserted or updated.
bool | allocateObjectOrdinates ()
| Locates memory to the ordinates.
int | queryType (void)
| Returns the query (statement SQL) type.
bool | transStart ()
| Starts a transaction.
bool | transRollback ()
| Rollbacks a transaction.
bool | transCommit ()
| Commits a transaction.
bool | execute (const string &stm)
| Executes only SQL statements that do not return rows (INSERT, UPDATE, DELETE, etc)
bool | executeSDOSTM (const string &stm)
| Executes only SQL statements that insert or update rows with SDO Objects.
bool | executeBLOBSTM (const string &stm, unsigned char *blobValue, const int &blobLength, const string &name)
| Executes only SQL statements that insert or update rows with BLOB.
bool | isConnected ()
| Checks if there is an opened conection.
bool | useSDOType ()
| Returns if the connected Oracle DBMS uses the SDO_GEOMETRY type.
bool | checkError (OCIError *errhp, int status)
| Checks OCI error handle.
string | getErrorMessage ()
| Gets the error message.

## Public Attributes

OCIType * | tdo_geometry_
| describes the SDO_GEOMETRY type
OCIType * | tdo_ordinates_
| describes the SDO_ORDINATES type
OCIArray * | ordinates_
| stores the ordinates to insert into database
unsigned char * | blobValue_
| stores the blob value that will be inserted into database
OCI connection handles
OCIEnv * | envhp_
| environment OCI handle
OCIError * | errhp_
| error OCI handle
OCIServer * | srvhp_
| service context OCI handle - represents a connection
OCISvcCtx * | svchp_
| service context OCI handle - defines a service
OCISession * | usrhp_
| service context OCI handle - defines the permissions and privileges associated to an user
OCITrans * | txnhp_
| service context OCI handle - controls the transactions
OCIStmt * | stmthp_
| environment OCI handle - stores SQL statement

## Protected Attributes

bool | connected_
| indicates if there is a connection opened or not
bool | useSDO_
| indicates if the connected Oracle DBMS uses the SDO_GEOMETRY type
string | errorMess_
| error message returned by the ORACLE DBMS

## Detailed Description

This class is used to connect to a ORACLE DBMS.

This class is reponsible for the connection to ORACLE DBMS using OCI (Oracle Call Interface) library.

## Constructor & Destructor Documentation

TeOCIConnection::TeOCIConnection | ( |  | ) |

Constructor.

TeOCIConnection::~TeOCIConnection | ( |  | ) | `[inline]`

Destructor.

## Member Function Documentation

bool TeOCIConnection::allocateObjectOrdinates | ( |  | ) |

Locates memory to the ordinates.

bool TeOCIConnection::appendOrdinates | ( | const double & | val | ) |

Appends ordinates to be inserted or updated.

bool TeOCIConnection::bindByName | ( | char * | name,
|  | void * | value,
|  | int | size,
|  | void * | indicator,
|  | int | type
| ) |  |

Binds objects by name.

bool TeOCIConnection::bindByPos | ( | int | pos,
|  | void * | value,
|  | int | size,
|  | void * | indicator,
|  | int | type
| ) |  |

Binds objects by position.

bool TeOCIConnection::bindOrdinates | ( |  | ) |

Binds ordinate object.

bool TeOCIConnection::checkError | ( | OCIError * | errhp,
|  | int | status
| ) |  |

Checks OCI error handle.

bool TeOCIConnection::connect | ( | const char * | dblink,
|  | const char * | username,
|  | const char * | password,
|  | const bool & | useSDO = `false`
| ) |  |

Connects to ORACLE DBMS.

Allocate a user session handle

void TeOCIConnection::disconnect | ( |  | ) |

Disconnects to ORACLE DBMS.

bool TeOCIConnection::execute | ( | const string & | stm | ) |

Executes only SQL statements that do not return rows (INSERT, UPDATE, DELETE, etc)

bool TeOCIConnection::executeBLOBSTM | ( | const string & | stm,
|  | unsigned char * | blobValue,
|  | const int & | blobLength,
|  | const string & | name
| ) |  |

Executes only SQL statements that insert or update rows with BLOB.

bool TeOCIConnection::executeSDOSTM | ( | const string & | stm | ) |

Executes only SQL statements that insert or update rows with SDO Objects.

string TeOCIConnection::getErrorMessage | ( |  | ) | `[inline]`

Gets the error message.

bool TeOCIConnection::isConnected | ( |  | ) | `[inline]`

Checks if there is an opened conection.

bool TeOCIConnection::prepare | ( | const string & | stmt | ) |

Prepares the SQL statement to be executed.

int TeOCIConnection::queryType | ( | void |  | ) |

Returns the query (statement SQL) type.

bool TeOCIConnection::transCommit | ( |  | ) |

Commits a transaction.

bool TeOCIConnection::transRollback | ( |  | ) |

Rollbacks a transaction.

bool TeOCIConnection::transStart | ( |  | ) |

Starts a transaction.

bool TeOCIConnection::useSDOType | ( |  | ) | `[inline]`

Returns if the connected Oracle DBMS uses the SDO_GEOMETRY type.

## Member Data Documentation

unsigned char* TeOCIConnection::blobValue_

stores the blob value that will be inserted into database

bool TeOCIConnection::connected_`[protected]`

indicates if there is a connection opened or not

OCIEnv* TeOCIConnection::envhp_

environment OCI handle

OCIError* TeOCIConnection::errhp_

error OCI handle

string TeOCIConnection::errorMess_`[protected]`

error message returned by the ORACLE DBMS

OCIArray* TeOCIConnection::ordinates_

stores the ordinates to insert into database

OCIServer* TeOCIConnection::srvhp_

service context OCI handle - represents a connection

OCIStmt* TeOCIConnection::stmthp_

environment OCI handle - stores SQL statement

OCISvcCtx* TeOCIConnection::svchp_

service context OCI handle - defines a service

OCIType* TeOCIConnection::tdo_geometry_

describes the SDO_GEOMETRY type

OCIType* TeOCIConnection::tdo_ordinates_

describes the SDO_ORDINATES type

OCITrans* TeOCIConnection::txnhp_

service context OCI handle - controls the transactions

bool TeOCIConnection::useSDO_`[protected]`

indicates if the connected Oracle DBMS uses the SDO_GEOMETRY type

OCISession* TeOCIConnection::usrhp_

service context OCI handle - defines the permissions and privileges associated to an user

The documentation for this class was generated from the following files:

- E:/Projetos_Primeiro_Semestre_2012/TerraView/terralib/src/terralib/drivers/Oracle/TeOCIConnect.h
- E:/Projetos_Primeiro_Semestre_2012/TerraView/terralib/src/terralib/drivers/Oracle/TeOCIConnect.cpp

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines