c++ occi linux

Discussion in 'C++' started by rahulonly4u, Mar 8, 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 am using OCCI library to connect my c++ code on Linux platform to oracle database

    when i m creating connection using

    env=Environment::createEnvironment();
    env.createConnection("scott","tiger",);

    here i left blank database name parameter when i don't specify database it connect to oracle but dint provide access to all databases but when i specify database name i.e.

    env.createConnection("scott","tiger","MYDB");
    it shows error that

    ORA-12154:TNS :could not resolve the connect identifier specified

    i have checked my tnsnames.ora file i have specified hame thier proprly and from some other client i am able to connect to oracle server using this names using sql developer



    what could be problem pls help me to find out solution


    Thanks and Regards
    Rahul
     
  2. xpi0t0s

    xpi0t0s Mentor

    Joined:
    Aug 6, 2004
    Messages:
    3,009
    Likes Received:
    203
    Trophy Points:
    63
    Occupation:
    Senior Support Engineer
    Location:
    England
    Using the same client Oracle Home, can you connect OK using sqlplus scott/tiger@MYDB ?
     

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