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