I am looking for a way to connect to an remote oracle database an开发者_运维百科d read some data from table within a c++ console application. Can some one give me some hints. Thnx.
soci, http://soci.sourceforge.net, is a reasonably modern C++ interface that uses the Oracle call interface. And can also connect to other databases ...
The official Oracle website proposes several resources. Amongst others:
- Oracle C++ Call Interface
- Develop C and C++ Applications with Oracle Database 11g Using OCI
Just google, there are really plenty of tutorials around.
You can either use the Oracle C++ Call Interface (native API) or the Open DataBase Connectivity API. If you want a more high-level wrapper, there are some more convenient interfaces in libraries such as Qt.
Unless it's study purpose or strict requirement with ORACLE DB, I'd suggest you to work with generic classes/services provided with various Microsoft Framework.
- Data Access Programming
- MFC Database classes
- ATL Database classes
- Of course ORCACLE C++ IF is also available.
You can use OCCI: http://www.oracle.com/technetwork/database/features/oci/index-090820.html
or OCI: http://www.oracle.com/technetwork/database/features/oci/index.html
or one of many other APIs available.. It really depends on the type of thing you're going to use it for.. You should find a lot of information about the pros/cons of the various APIs through google..
You can try: CODBC
. It is an API for Pro*C
. Pro*C
is a very decent way to connect Oracle and C++.
Currently (2021) actively developed is also OCILIB, I was able to setup the test example in short time.
精彩评论