Sign in to follow this  

C++ and Databases

This topic is 3851 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello all, I have a question for those who have used databases and C++. Do you have a recommended API that works fine on Windows and Linux for Oracle and MySQL? It is fine if it wraps one and if I download something else it can wrap the other. I just don't want to write MySQL specific code and then have to rip it out if we want to use Oracle. I also don't want to write my own wrapper if one already exists. Windows isn't too important, since I've been living without it for this long. If it works, all the better. Up until now we've been using perl and it "works" but perl's garbage collection is lazy (and I have no idea why the memory gets up to 500MB usage). I was also looking at Java, but it seems like a pain since the linux machines don't have Java set up properly. Any links to docs, downloads, etc are appreciated.

Share this post


Link to post
Share on other sites
If you've been using Perl, then maybe you won't mind using Python, which offers a variety of API to deal with RDBMS.

Other than that, I believe that a few C++ API out there can deal with both Oracle and MySQL in an abstract way. It's all down to the license you want to pick:


  • Trolltech's Qt (fullblown toolkit): GPL or proprietary (the latter costing money),

  • apparently Ultimate++ provides DB access and maybe data-aware widgets, but I haven't seen anything like it in the online doc when I looked at it (fullblown toolkit): BSD,

  • SQLAPI++: proprietary (shareware),

  • ODBC with the UnixODBC implementation for *NIX-like systems: LGPL,

  • SQL Relay (probably overkill, not production-ready for Windows): GPL,

  • YADA (C API, binary types not working in Oracle and Postgresql yet, don't know if it works on Windows): GPL,

  • probably a lot more.



Out of that bunch, I'd say that ODBC and Qt are your best choices, because they are crossplatform and solid. I know I'm forgetting at least one important API, but I can't seem to remember at the moment.

For DB stuff, I'd just go with a HLL and be done with it, unless I had to do very intensive computations on the client-side. For the typical enterprise application, however, the client will likely be waiting for I/O most of the time.

Hope this helps.

Share this post


Link to post
Share on other sites
Quote:
Original post by let_bound
If you've been using Perl, then maybe you won't mind using Python, which offers a variety of API to deal with RDBMS.

For DB stuff, I'd just go with a HLL and be done with it, unless I had to do very intensive computations on the client-side. For the typical enterprise application, however, the client will likely be waiting for I/O most of the time.

Hope this helps.


I will take a look at what Python has to offer. It has to be pretty quick with dict/map/hash, sorting, and things like perl's join/split. Also needs to clean up garbage (or let me do it)

This is for the server, so everything is waiting for it. Other people have to make the queries quicker (or the php code) and I have to make this app quicker/lighter.

Thanks++, I will take a look at Qt over the weekend.

Share this post


Link to post
Share on other sites

This topic is 3851 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this