Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

C++ and imbedded sql

Status
Not open for further replies.

mover50

Programmer
Aug 3, 2004
77
US
Anyone know where to find a book or tut on how to code imbedded sql in C++, preferably on linux? I would like to find one that has some hands on stuff, where you can do everything from creating a db, table to maintaining it and creating reports.

Thanks,

Kent
 
Any particular database? There are all sorts. Some of them are of the form

Execute (string, param1, param2..)

where string is an sql statement and param1 etc are the positional parameters probably flagged by ::p1:: or something similar. OCI uses this format.

An alternative one is a preprocessor type like ProC which Oracle uses. The code has to be passed to a preprocessor which converts the SQL calls to something else. The problem with these is that you cannot use enums and nested #defines. The preprocessors aren't that clever.

Alternatively, you could try SQLLite which is a database completely written in C that is portable to any OS (including palmtops).
 
Since this is Linux, look at the mysql libs which contains all the functions that you require.

Define a Db class for your interface, and then at any time you can just replace that class for other flavors of a database.
 
Any particular database? There are all sorts. Some of them are of the form

MySQL. Looking for a book/manual/tutorial that details how to do it. Need more than generalities. I am in process of learning C++ an would like to learn about using C++ to interface with a database as I learn.
I don't want to have to learn all about C++ from A to Z first before I can learn about how to interface with a database.

Also, is there a way to use the wget command in a C++ program or for that matter, other linux commands?

Thanks,

Kent
 
has a document that shows all the functions.

rc = system("wget <parms>");
should do it. There are other functions like the exec also.
 
has a document that shows all the functions

Guess I don't know where to look. I can't find anything there regarding MySQL functions for C++.

Thanks,

Kent
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top