This discussion is archived
3 Replies Latest reply: Apr 5, 2012 9:30 PM by 423410 RSS

OCCI For 10g

709973 Newbie
Currently Being Moderated
Hello,

I'm very confused about how to install OCCI. I'm on Windows 7 using Visual C++ 2010, and want to write a program to connect to an Oracle 10g database.

The problem is I cannot find a version of OCCI for 10g.

This is the only page I've found offering downloads ( http://www.oracle.com/technetwork/database/features/oci/index-090820.html ), but the only files offered target 11.2.0.2.0 and 11.1.0.7.0.

Am I looking in the wrong place? Can I use these files? All of my searches for a specific 10g version are coming up empty.

Any guidance would be greatly appreciated. Thank you.
  • 1. Re: OCCI For 10g
    kmohan Explorer
    Currently Being Moderated
    You will find OCCI 10g as part of 10g client installation. But that does not work with VS2010. You need to download the 11.2.0.2 OCCI libraries that are compatible with VS2010 and use them with 11.2.0.2 client software.

    You can use that above (11.2.0.2 client) to connect to a 10.2 database.
  • 2. Re: OCCI For 10g
    928756 Newbie
    Currently Being Moderated
    I have installed vc2008 express edi and oracle 10g express edition.I have written this code :

    #include <iostream>
    #include <occi>

    using oracle :: occi;
    using namespace std;

    int main(){

    oracle::occi::Environment* environment;
    oracle::occi::Connection *con;
    oracle::occi::Statement* stmt;
    oracle::occi::ResultSet* res;

    try{

    environment = oracle::occi::Environment::createEnvironment(oracle::occi::Environment::DEFAULT);
    con = environment->createConnection("gldbuser", "gldbuser", "MYDATABSE");

    stmt = con->createStatement("select * from example");
    res = stmt->executeQuery();

    while (res->next())
    std::cout<<res->getInt(1)<<" "<<res->getString(2)<<std::endl;

    stmt->closeResultSet(res);
    con->terminateStatement(stmt);
    environment->terminateConnection(con);

    }catch(oracle::occi::SQLException &e){
    std::cout<<e.what();
    }

    return 0;
    }



    It giving me error

    \connectivity.cpp(20) : error C2872: 'Environment' : ambiguous symbol
    1> could be 'C:\Program Files\Microsoft Visual Studio 9.0\VC\include\occiControl.h(732) : oracle::occi::Environment'
    1> or 'c:\windows\microsoft.net\framework\v2.0.50727\mscorlib.dll : System::Environment'

    Please give me solution for that
  • 3. Re: OCCI For 10g
    423410 Explorer
    Currently Being Moderated
    Did you check if OCCI dlls in 10g XE are built using VS2008. If not you have to use the same version of VS used in building the OCCI dlls.
    You can do dumpbin to know the dependency and the version from it.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points