dbTalk Databases Forums  

sqlplus v. OCI v. OCCI connect

comp.databases.oracle.tools comp.databases.oracle.tools


Discuss sqlplus v. OCI v. OCCI connect in the comp.databases.oracle.tools forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Shane
 
Posts: n/a

Default sqlplus v. OCI v. OCCI connect - 04-30-2009 , 06:14 PM






this command connects to oracle:

$ sqlplus smiller/mill99@oradev

A OTL based program which uses smiller/mill99@oradev as a connection
string connects to Oracle.
A working OCI program here which was gutted to use user=smiller,
password=mill99, db=oradev connects to Oracle.

But an OCCI program with this code:

52 Environment* const env = Environment::createEnvironment(
53 Environment:EFAULT);
54
55 // Open a connection to the database, then close it.
56 //
58 try
59 {
60 Connection* const con = env->createConnection(user, pass,
osid);

throws on line 60 giving:

Can't connect: ORA-01017: invalid username/password; logon denied

What in the heck is the deal with OCCI? My OTL code worked the first
time, no problem. I guess OTL is based on OCI, which works How is
connecting to the db with OCCI so different from OCI, OTL, sqlplus?
How can I fix this error?

tnsping oradev gives:

$ tnsping oradev

TNS Ping Utility for Solaris: Version 10.2.0.3.0 - Production on 30-
APR-2009 19:11:28

Copyright (c) 1997, 2006, Oracle. All rights reserved.

Used parameter files:

Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS =
(PROTOCOL = TCP)(HOST = sundev16)(PORT = 28538))) (CONNECT_DATA =
(SERVICE_NAME = oradev.bloomberg.com)))
OK (10 msec)

Reply With Quote
  #2  
Old   
Michael Austin
 
Posts: n/a

Default Re: sqlplus v. OCI v. OCCI connect - 05-01-2009 , 02:09 PM






Shane wrote:
Quote:
this command connects to oracle:

$ sqlplus smiller/mill99@oradev

A OTL based program which uses smiller/mill99@oradev as a connection
string connects to Oracle.
A working OCI program here which was gutted to use user=smiller,
password=mill99, db=oradev connects to Oracle.

But an OCCI program with this code:

52 Environment* const env = Environment::createEnvironment(
53 Environment:EFAULT);
54
55 // Open a connection to the database, then close it.
56 //
58 try
59 {
60 Connection* const con = env->createConnection(user, pass,
osid);

throws on line 60 giving:

Can't connect: ORA-01017: invalid username/password; logon denied

What in the heck is the deal with OCCI? My OTL code worked the first
time, no problem. I guess OTL is based on OCI, which works How is
connecting to the db with OCCI so different from OCI, OTL, sqlplus?
How can I fix this error?

tnsping oradev gives:

$ tnsping oradev

TNS Ping Utility for Solaris: Version 10.2.0.3.0 - Production on 30-
APR-2009 19:11:28

Copyright (c) 1997, 2006, Oracle. All rights reserved.

Used parameter files:

Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS =
(PROTOCOL = TCP)(HOST = sundev16)(PORT = 28538))) (CONNECT_DATA =
(SERVICE_NAME = oradev.bloomberg.com)))
OK (10 msec)

is there a reason why you are multi-posting in all of the oracle NGs?
Those of us that follow on, generally follow all...


Reply With Quote
  #3  
Old   
Shakespeare
 
Posts: n/a

Default Re: sqlplus v. OCI v. OCCI connect - 05-01-2009 , 05:25 PM



Michael Austin schreef:
Quote:
Shane wrote:
this command connects to oracle:

$ sqlplus smiller/mill99@oradev

A OTL based program which uses smiller/mill99@oradev as a connection
string connects to Oracle.
A working OCI program here which was gutted to use user=smiller,
password=mill99, db=oradev connects to Oracle.

But an OCCI program with this code:

52 Environment* const env = Environment::createEnvironment(
53 Environment:EFAULT);
54
55 // Open a connection to the database, then close it.
56 //
58 try
59 {
60 Connection* const con = env->createConnection(user, pass,
osid);

throws on line 60 giving:

Can't connect: ORA-01017: invalid username/password; logon denied

What in the heck is the deal with OCCI? My OTL code worked the first
time, no problem. I guess OTL is based on OCI, which works How is
connecting to the db with OCCI so different from OCI, OTL, sqlplus?
How can I fix this error?

tnsping oradev gives:

$ tnsping oradev

TNS Ping Utility for Solaris: Version 10.2.0.3.0 - Production on 30-
APR-2009 19:11:28

Copyright (c) 1997, 2006, Oracle. All rights reserved.

Used parameter files:

Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS =
(PROTOCOL = TCP)(HOST = sundev16)(PORT = 28538))) (CONNECT_DATA =
(SERVICE_NAME = oradev.bloomberg.com)))
OK (10 msec)


is there a reason why you are multi-posting in all of the oracle NGs?
Those of us that follow on, generally follow all...
Which makes me wonder: why not make one group instead of three? Saves us
twice the spam!

Shakespeare


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.