| TerraLib 4.1

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

- File List
- File Members

E:/Projetos_Primeiro_Semestre_2012/TerraView/terralib/src/terralib/drivers/Oracle/TeOCIConnect.h
Go to the documentation of this file.

    00001 /************************************************************************************
    00002 TerraLib - a library for developing GIS applications.
    00003 Copyright © 2001-2007 INPE and Tecgraf/PUC-Rio.
    00004
    00005 This code is part of the TerraLib library.
    00006 This library is free software; you can redistribute it and/or
    00007 modify it under the terms of the GNU Lesser General Public
    00008 License as published by the Free Software Foundation; either
    00009 version 2.1 of the License, or (at your option) any later version.
    00010
    00011 You should have received a copy of the GNU Lesser General Public
    00012 License along with this library.
    00013
    00014 The authors reassure the license terms regarding the warranties.
    00015 They specifically disclaim any warranties, including, but not limited to,
    00016 the implied warranties of merchantability and fitness for a particular purpose.
    00017 The library provided hereunder is on an "as is" basis, and the authors have no
    00018 obligation to provide maintenance, support, updates, enhancements, or modifications.
    00019 In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
    00020 indirect, special, incidental, or consequential damages arising out of the use
    00021 of this library and its documentation.
    00022 *************************************************************************************/
    00027 #ifndef OCI_CONNECT_H
    00028 #define OCI_CONNECT_H
    00029
    00030 #include <oci.h>
    00031 #include <string>
    00032
    00033 #include "TeOracleDefines.h"
    00034
    00035 using namespace std;
    00036
    00042 class TLORACLE_DLL TeOCIConnection
    00043 {
    00044 protected:
    00045            bool            connected_;
    00046            bool                   useSDO_;
    00047            string       errorMess_;
    00048
    00049 public:
    00053            OCIEnv*                          envhp_;
    00054            OCIError*             errhp_;
    00055
    00056            OCIServer*            srvhp_;
    00057            OCISvcCtx*            svchp_;
    00058            OCISession*                      usrhp_;
    00059            OCITrans*             txnhp_;
    00060
    00061            OCIStmt*              stmthp_;
    00062
    00063
    00064            OCIType*              tdo_geometry_;
    00065            OCIType*              tdo_ordinates_;
    00066            OCIArray*             ordinates_;
    00067
    00068            unsigned char*        blobValue_;
    00069
    00070 public:
    00071
    00073            TeOCIConnection();
    00074
    00076            ~TeOCIConnection() { disconnect(); }
    00077
    00079            bool connect(const char* dblink, const char* username, const char* password, const bool& useSDO = false);
    00080
    00082            void disconnect();
    00083
    00085            bool prepare(const string& stmt);
    00086
    00088            bool bindByPos(int pos, void* value, int size, void* indicator, int type);
    00089
    00091            bool bindByName(char* name, void* value, int size, void* indicator, int type);
    00092
    00094            bool bindOrdinates();
    00095
    00097            bool appendOrdinates(const double& val);
    00098
    00100            bool allocateObjectOrdinates();
    00101
    00103            int        queryType(void);
    00104
    00106            bool transStart();
    00107
    00109            bool transRollback();
    00110
    00112            bool transCommit();
    00113
    00115            bool execute(const string& stm);
    00116
    00118            bool executeSDOSTM(const string& stm);
    00119
    00121            bool executeBLOBSTM(const string& stm, unsigned char* blobValue, const int& blobLength, const string& name);
    00122
    00124            bool isConnected() { return connected_; }
    00125
    00127            bool useSDOType() { return useSDO_; }
    00128
    00130            bool checkError(OCIError* errhp, int status);
    00131
    00133            string getErrorMessage() { return errorMess_; }
    00134 };
    00135
    00136 #endif

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines