Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

OCCI ORA-12560: TNS:protocol adapter error when connecting to remote database

3194571Jun 28 2016 — edited Jul 11 2016

Hi all,

I have an instance of a database running on remote machine. I can connect to it using SQL Developer or SQL Plus, for example

sqlplus.exe user/password@//myhostname:1521/servicename

but when I try to do the same from my app, I get the error:

ORA-12560: TNS:protocol adapter error when connecting to remote database

void start() {

  Environment* env = Environment::createEnvironment(Environment::DEFAULT);

   Connection* connection = env->createConnection (username, password, oracleConnectionString); // <-- SqlException ORA-12560, where oracleConnectionString is //myhostname:1521/servicename

  Environment::terminateEnvironment(env);

}

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 8 2016
Added on Jun 28 2016
13 comments
10,320 views