connectivity between c++ and oracle database

Posted on 2002-04-30
Last Modified: 2012-05-04
how to connect oracle database through c++ programming.........want some sample code........
Question by:akmak
LVL 32

Expert Comment

ID: 6982102
Oracle has available a developers toolkit if you want to make a "native" interface from C++ to Oracle.  

But most developers choose to use the Oracle ODBC driver.

Check with your Oracle sales rep. for the developer product.

You probably got the ODBC driver with your Oracle software.

Accepted Solution

zebada earned 50 total points
ID: 6982712

Expert Comment

ID: 6983478
Depending on what you're trying to do, there are simpler options than OCI.  The Pro C/C++ precompiler is an option that lets you embed SQL in your code, then run it through a program Oracle provides that creates all the OCI code necessary to retrieve that data from the database.

There are also a few OCI wrappers that greatly simplify the task of accessing the database for your typical data retrievals.  Three of them are found at the bottom of this page:

I recently switched from using straight OCI to the Oracle Template Library (OTL) package mentioned.  I've found it to greatly simplify your typical database accesses.  The page includes docs and over a hundred examples.  

Depending on exactly what you're trying to do, give one of these libraries a try.
LVL 11

Expert Comment

ID: 7122236
Dear akmak

I think you forgot this question. I will ask Community Support to close it unless you finalize it within 7 days. You can always request to keep this question open. But remember, experts can only help you if you provide feedback to their questions.
Unless there is objection or further activity,  I will suggest to accept


comment(s) as an answer.

If you think your question was not answered at all, you can explain here why you want to do this and post a request in Community support (please include this link) to refund your points. The link to the Community Support area is:


Expert Comment

ID: 7138146
Force accepted

** Mindphaser - Community Support Moderator **

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now