dB connection c++ with oracle using OCCI at linux

Discussion in 'C++' started by rahulonly4u, Mar 1, 2011.

  1. rahulonly4u

    rahulonly4u New Member

    Joined:
    Sep 6, 2010
    Messages:
    29
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    software developer
    Location:
    india
    HI i wana connect my c++ application with oracle running on linux platform i am using OCCI library for this and my environment variables are set poerly i have writen follwoing gode for this but i am geeting following eroor msg at the time of compilation-----

    [NOPARSE]/home/oracle/NetBeansProjects/TrialCppApp/main.cpp:29: undefined reference to `oracle::eek:cci::Environment::createEnvironment(oracle::eek:cci::Environment::Mode, void*, void* (*)(void*, unsigned int), void* (*)(void*, void*, unsigned int), void (*)(void*, void*))'[/NOPARSE]


    I AM USINT NetBens IDE how to add locci and

    Code:
    #include <cstdlib>
    #include <iostream>
    #include<occi.h>
    
    # define  NO_OF_LOBS 10
    using namespace oracle::occi;
    using oracle::occi::Environment;
    using oracle::occi::Connection;
    using namespace std;
    /*
     * 
     */
    int main(int argc, char** argv) {
    
        Environment* env;
        Connection *conn;
        string username;
        string password;
        string databse;
    
        try{
    env = [COLOR=Purple]Environment::createEnvironment(Environment::DEFAULT);  //stmt causing error [/COLOR]             
    
        }catch(oracle::occi::SQLException &e)
        {
         cout<<"Error in sql ";
        }
        cout<<"hi";
        return 0;
    }
    
    
    please tell me where i am doing mistake

    Thanks and Regards
     
    Last edited: Mar 1, 2011
  2. xpi0t0s

    xpi0t0s Mentor

    Joined:
    Aug 6, 2004
    Messages:
    3,009
    Likes Received:
    203
    Trophy Points:
    63
    Occupation:
    Senior Support Engineer
    Location:
    England
    Pleez lern tu spel. Yore messij iz verchoowully uncomrihencubbubble.

    Thic eroooooor meenz yoov mist owt a laibury frum yuz link laiyn. Wear yu invowc teh lyncuh, yow knead tu ad a "-locci" oar juct a refruns tu libocci.a if yu ulridy av het dairekturi spesifeyed wiv a -L.
     
  3. light_haui

    light_haui New Member

    Joined:
    May 11, 2011
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    you use window or linux
    download 2 file for linux
    1.instantclient-basic-linux32-11.2.0.2.0.zip
    2.instantclient-sdk-linux32-11.2.0.2.0.zip

    unzar to folder .
    netbean \project \properties\c++ compiler add directory to folder unzar two file .instantclient-basic-linux32-11.2.0.2.0.zip
    2.instantclient-sdk-linux32-11.2.0.2.0.zip
    to sdk/include add file.h
    goto tag linker/libraries add 4 file .so libocci ,liboieci,lnsth,nnzz
    on tag linke /add libraries directory to folder unzar two file installclien
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice