user2090833
user2090833

Reputation: 21

Oracle DB Server connectivity using c++

I have written C++ programmes in Linux environment. Currently i need to work on Visual Studio 2005 version.

I have a task where i need to fetch some data from Oracle database. I have never done this type of task before.

I just googled and found out that it can be possible by C++ and also C#. As i have to use only Visual Studio 2005, which approach should be better - C++ or C#?

I found out from google that i can use either OLE DB or OCCI using C++. If its C#,i should use OLE DB.

Would you please suggest which language and approach i should use for this task?

Upvotes: 1

Views: 1517

Answers (1)

jessehouwing
jessehouwing

Reputation: 114461

Caution

I'd seriously caution you not to use Visual Studio 2005, not because it isn't a great tool, but because it is seriously outdated, Visual Studio 2008, 2010 and now 2012 have brought great improvements. Managed C++ has improved a lot since 2005. New extensions and add-ons are no longer being released with 2005 support and the support for a number of technologies (such as Team Foundation Server, WCF, Windows Presentation Foundation and others) are not well supported or supported at all on this version. Depending on what you're trying to do and how advanced the things are you're planning, you should research the Visual Studio Express editions which are free and are supported for commercial projects.

C# vs C++

I'm not going into the discussion whether C# or C++ is better, if you are well versed with C++, then it's probably easier for you to keep using C++. Personally I find C# a lot easier to program due to the fact that the .NET framework abstracts away a lot of the difficult parts of building a complex application. This is going to be your decision to make entirely.

Database technologies

To connect to Oracle databases on the Windows platform you have a number of options:

  • ODBC, The precursor to OleDB. It's well documented and you will probably be able to find loads of examples on how to use it from C++, doesn't abstract the database as well and might require more local setup. Support for ODBC is declining since the release of OleDB and ADO.NET.
  • Ole DB, the improved version with abstraction over the database providers so that you (in theory) should be able to switch database platforms. Good support for Native C++, Managed C++ and C#.
  • ADO.NET, In combination with the Oracle Data Provider for .NET provides very good support for C# and Managed C++. Can be easily reused on different database through abstractions. Designer support and code generation (Entity Framework).
  • Oracle Native API (Oracle Client), deep native integration, probably fastest of the bunch in terms of execution, dedicated code for the oracle database platform, cannot be reused. I suspect that you won't find designer support of any sort inside Visual Studio, since that all focuses on ADO.NET nowadays.

Upvotes: 1

Related Questions