Q

How does database connectivity work in C++?

How does database connectivity work in C++?

You'll want to use one of two methods: Pro*C or OCI for C++. Both are Oracle products and are installed with your database software. Pro*C is the easiest of the two to use, but OCI has all of the power. With Pro*C, you place SQL statements in your C++ code. You also place the simple statements to make a database connection and disconnection in your C++ code. Before you compile the C++ code, you run your source program through a precompiler. This precompiler essentially takes your simple database lines of code in your C++ source code and expands it into everything that is needed to perform that statement. You then run your precompiled code through your C++ compiler.

I would highly recommend reading the Pro*C/C++ Precompiler Programmer's Guide. It contains sample code to help you along the way. You can find a copy of that doc here:

http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a97269/toc.htm
This was first published in October 2004

Dig deeper on Oracle database backup and recovery

Pro+

Features

Enjoy the benefits of Pro+ membership, learn more and join.

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide

SearchDataCenter

SearchContentManagement

SearchFinancialApplications

Close