#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2003
    Location
    Sydney , Australia
    Posts
    3
    Rep Power
    0

    Lightbulb Best way to communicate with database (mysql/pgsql etc) in C++ under Linux/FreeBSD ?


    Hi ,

    I wanted to access Database from C++ in Linux.

    I am currently using :

    libpqxx of PostgreSQL under c++ (gcc).


    but i wanted to use:

    unixODBC/iODBC with any database..
    but then i have to use some c++ database library like :

    DATABASE template library (DTL)
    http://dtemplatelib.sourceforge.net/...troduction.htm

    or
    libODBC++/FreeODBC++
    http://orcane.net/freeodbc++/

    DTL is too complicated to use and documented poorly !!

    and libODBC++ doesn't compile properly
    and it's interface also looks complicated and poorly documented..

    libpqxx of PostgreSQL works great ! ...
    but i am kinda limited to one database platform...

    Please advice me , if you know any better solution.

    Thanks for your time .:) :)
  2. #2
  3. Big Endian
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    May 2001
    Location
    Fly-over country
    Posts
    1,172
    Rep Power
    30
    This may not be of any interest to you since it is a commercial product, but I've been using it for a couple of years and have found it to be very useful for working with different databases on different hardware.

    http://www.sqlapi.com

    It supports Oracle, MS SQL, Sybase, DB2, Informix, Interbase/Firebird, Centura SQLBase, MySQL and Postgresql on Windows, Linux and Solaris. For me, it was worth the money but you would have to determine if it fits your needs.

    OTL is in the same ballpark as DTL so I don't know if using it would gain you anything. I've never used it, so I can't make a recommendation.
    http://otl.sourceforge.net/
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2003
    Location
    Sydney , Australia
    Posts
    3
    Rep Power
    0

    Wink thanks !


    thanks,

    but i am only looking for Open Source solution ..

    DTL/OTL works fine .. but it's very complicated to use and very poorly documented ..

    i am wondering ,, how big open source programms interact with database..

    how PHP , CGIs (those written in c++) achieve this ?
  6. #4
  7. Big Endian
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    May 2001
    Location
    Fly-over country
    Posts
    1,172
    Rep Power
    30
    Most of the PHP cross-database programs I've seen use ADOdb . But from what I can tell, this is just for using PHP to connect to multiple databases, not C++. But don't take my word for it because I'm not a web programmer. There might be something useful there.

    The guys at the Gnome project wrote a database abstraction layer called GNOME-DB . Read the introduction and see if it is what you're looking for.

    Also you might want to take a look at these:
    http://tazthecat.net/~isaac/sqloco/
    http://gql.sourceforge.net/
    http://dbstep.sourceforge.net/
    http://hk-classes.sourceforge.net/
    http://sourceforge.net/projects/dbconnect/
    Last edited by dcaillouet; May 25th, 2003 at 06:44 AM.
  8. #5
  9. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2003
    Posts
    6
    Rep Power
    0

    Lightbulb Thanks !


    Thanks ! dcaillouet :) :)

    I am looking in to GNOME-DB now..
    (but no success yet !)

    maybe this is the solution i am looking for ...


    Cheers,

    maulik

IMN logo majestic logo threadwatch logo seochat tools logo