Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C++ (http://www.go4expert.com/forums/cpp/)
-   -   c++ occi linux (http://www.go4expert.com/forums/cpp-occi-linux-t25184/)

rahulonly4u 8Mar2011 12:37

c++ occi linux
 
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

xpi0t0s 9Mar2011 15:05

Re: c++ occi linux
 
Using the same client Oracle Home, can you connect OK using sqlplus scott/tiger@MYDB ?


All times are GMT +5.5. The time now is 22:47.