getting database connectivity in c++

978 Views Asked by At

How can I create a database using SQL in c++?

I tried going according to the steps I found on a website(which required all this to be on codeblocks) by downloading the SQLAPI++ library for c++. Next it instructed to download oracle c++ call interface, which I downloaded but didn't understand, how to integrate the library with my Codeblocks project.

If you know any other method it would be much appreciated.

1

There are 1 best solutions below

0
On BEST ANSWER

In general:

Standard c++ doesn't support SQL database/server connections out of the box. You need to have a 3rd party product to achieve this.

Many SQL standard compliant DB systems support C or C++ APIs you can use for that.
To name a few:

  • SQLite
  • PostgreSQL
  • MariaDB
  • MySQL
  • ... a by no means complete list ...

Another alternative is to use a generic ODBC interface implementation, which might also support specific database servers, and SQL standard versions.

In particular:

  • Codeblocks is ypur IDE, it manages projects and their dependencies on libraries.
  • You seem to have a solution at hand, which uses the framework library
  • You need to integrate the underlying SQL server system in turn of configuring that above mentioned API
  • You may need to link the native support for that specific SQL API of the server system

To do these steps mentioned above you'll need to install (maybe development versions) of the above mentioned APIs, SDKs, ... (whatever they'll call it) and integrate those with your IDE project (related Q&A link regarding this).