Connect to oracle database with C++

强颜欢笑 提交于 2021-02-04 13:37:32

问题


I am looking for a way to connect to an remote oracle database and read some data from table within a c++ console application. Can some one give me some hints. Thnx.


回答1:


soci, http://soci.sourceforge.net, is a reasonably modern C++ interface that uses the Oracle call interface. And can also connect to other databases ...




回答2:


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.




回答3:


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.




回答4:


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.



回答5:


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..




回答6:


You can try: CODBC. It is an API for Pro*C. Pro*C is a very decent way to connect Oracle and C++.



来源:https://stackoverflow.com/questions/7334632/connect-to-oracle-database-with-c

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!