Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2006
    Posts
    31

    Unanswered: OCCI - connection string

    how does c++ know where to find the oracle DB from

    Code:
    Connection* con = env->createConnection( "name", "passwrd", "string");??

  2. #2
    Join Date
    Aug 2004
    Location
    France
    Posts
    754
    "string" stands either for the connection name that is resolved with the Oracle "tnsnames.ora" file which should be located in your ORACLE_HOME(Oracle install dir)\NETWORK\ADMIN directory or for a connection string like this one :
    Code:
    connection_name =
      (DESCRIPTION =
           (ADDRESS=(PROTOCOL = TCP)(HOST = ip_address)(PORT = listener_port))
        (CONNECT_DATA=
          (SERVICE_NAME = listener_service_name)
          (SERVER = DEDICATED)
        )
      )
    Where :

    connection_name = the name you want for this connection, eg : "CON1"

    ip_address = the ip address of the machine on which the Oracle instance is running

    listener_port = the port on which the Oracle listener is listening, the default value is 1521.

    listener_service_name = the name of the service corresponding to the instance you want to connect to. If you don't know it, then issue "lsnrctl status" on the machine running the instance and you will see which services are managed by the listener.

    HTH & Regards,

    rbaraer
    ORA-000TK : No bind variable detected... Shared Pool Alert code 5 - Nuclear query ready .

  3. #3
    Join Date
    Aug 2006
    Posts
    31

    Lightbulb

    ahh i see now

    ive found the tsnnames.ora file... and read it and found the DB i was looking for

    how do i add that into c++? is there an example you could show me

    thanks again!

  4. #4
    Join Date
    Aug 2006
    Posts
    31
    okay i have caught the error the program is giving me

    "ORA-24960 the attribute OCI_ATTR_USERNAME is over 255 characters"

    ...which it isnt

    im using VC++ Express 2005. Is there a known solution to this error?

    Cheers,

    Scott

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •