简体   繁体   中英

Using OCCI - create connection

Is there anyone using OCCI library for work with Oracle database? I'm trying to connect from Visual Studio 2017 project

Environment *env = Environment::createEnvironment(Environment::DEFAULT);
Connection *con;
con = env->createConnection(Config::login, Config::password, "(DESCRIPTION = (ADDRESS = (PROTOCOL = 'TCP')(HOST = my.host.cz')(PORT = '1510'))(CONNECT_DATA = (SID = 'mySid')))");

but I get errors:

ORA-12163: TNS:connect descriptor is too long

or

ORA-12560: TNS:protocol adapter error

I don't know how to execute tnsping from my computer, but somebody else tried it from his one using my connect descriptor, and it was OK.

Maybe I'm not including correct libraries.

I'm using OCCI version 12.2.0.1.0 , Basic Package and SDK Package downloaded from here .

Can anyone tell me what am I missing and how can I create the connection?

问题是我使用的是OCCI版本12,并尝试连接到版本11的服务器。下载OCCI版本11很有帮助。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM