MySQL C API or ODBC?

This is a discussion on MySQL C API or ODBC? within the C Programming forums, part of the General Programming Boards category; i'm about to start on a program that uses a database. which do you think is better to use, the ...

  1. #1
    Registered User
    Join Date
    Dec 2004
    Posts
    25

    MySQL C API or ODBC? / embedded MySQL?

    i'm about to start on a program that uses a database. which do you think is better to use, the mysql c api: http://dev.mysql.com/doc/mysql/en/index.html
    or odbc:
    http://www.unixodbc.org/?
    Last edited by serfurj; 02-01-2005 at 07:33 PM.

  2. #2
    Super Moderator
    Join Date
    Sep 2001
    Posts
    4,913
    I don't know much about odbc, but judging by the link you have provided, it appears that the MySQL API is the only one of the two that provides cross-platform functionality. If this is true (i.e. if odbc is indeed a Unix-only mechanism) than I would definitely choose MySQL.

  3. #3
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,265
    ODBC stands for Open DataBase Connectivity. It is a Standard way to have an application access a database. The good thing about using ODBC is that if you switch your database from MYSQL to Oracle, or some other database which supports ODCB, then you dont have to change any of your code.

    If you know for certain that you are only going to use Mysql, then you can use the Mysql API (It's a bit easier to use than messing with ODBC drivers). If you want your code to be as flexible as possibe, supporting multiple database types, then use ODBC.

  4. #4
    Registered User
    Join Date
    Dec 2004
    Posts
    25
    thanks for the input. i think i'll go with mysql's api since it looks like a lot less hassle and i don't think it's a big deal to have mysql as a dependency.

    also, does anyone have experience with embedded mysql? is it worth looking into?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C API for MySQL
    By gvector1 in forum C Programming
    Replies: 10
    Last Post: 03-16-2011, 03:07 AM
  2. MySQL C API Header File Problems
    By WarrenKeyes3 in forum C Programming
    Replies: 3
    Last Post: 03-26-2009, 03:26 PM
  3. mysql API in c
    By vapanchamukhi in forum C Programming
    Replies: 1
    Last Post: 10-03-2008, 04:31 AM
  4. MySQL C API Forum
    By rotis23 in forum Linux Programming
    Replies: 2
    Last Post: 12-13-2002, 03:16 AM
  5. mysql c api problems
    By rotis23 in forum C Programming
    Replies: 0
    Last Post: 10-07-2002, 05:15 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21