Ask the Expert

Oracle back end with a C++ front end?

Can Oracle be used as a back end with C++ as front end? How?

    Requires Free Membership to View

Oracle can be used as a backed for many development language's applications, including C++ applications. You just need to get your C++ application connected to the database and issuing SQL statements against that database. Oracle has two different products for C++ applications. You can use either Oracle's precompiler, called Pro*C, or the Oracle C API Interface, called OCI.

Pro*C is very simple to use. You just place "EXEC SQL" statements in your C++ code. This statement will also contain the SQL operation you wish to perform. After your code is written, you run your code through the precompiler which changes those EXEC SQL statements to OCI calls. Then you compile your code. Pro*C makes it simple by removing all of the pesky OCI details. Unfortunately, after your program is run through the precompiler, the code can grow quite signficantly! So while it's easy to use, code growth can make it an unattractive solution.

OCI is much harder to use. You have to know more about the details of the code. But your code will compile right away and you won't see the code growth like Pro*C programs. And your code may be much more efficient with OCI.

So you have two options to use!!

For More Information

  • What do you think about this answer? E-mail the editors at editor@searchDatabase.com with your feedback.
  • The Best Oracle Web Links: tips, tutorials, scripts, and more.
  • Have an Oracle or SQL tip to offer your fellow DBAs and developers? The best tips submitted will receive a cool prize. Submit your tip today!
  • Ask your technical Oracle and SQL questions -- or help out your peers by answering them -- in our live discussion forums.
  • Ask the Experts yourself: Our SQL, database design, Oracle, SQL Server, DB2, metadata, object-oriented and data warehousing gurus are waiting to answer your toughest questions.

This was first published in March 2002

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

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: