954,483 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

C++ Client: connect to MySQL from C++ using MySQL++

I am looking for a good C++ example of a simple MySQL client program written in C++ and runs on Linux, using MySQL++ libraries that does the following (no threading):

Accessing Option File Contents, ~/.my.cnf, in user home folder to read settings (load_defaults).

Constructing and sending the sql statement that return result set in away I can get the result row by row from the server (mysql_use_result). Rather than getting whole result set and storing in memory on the client side.

Catching MySQL errors

All of this is type of work is done in C by Paul DuBois, in the book MySQL. There is the sample chapter 6: http://www.kitebird.com/mysql-book/ch06-3ed.pdf that does the explanation. C code there only support MySQL 5 not MySQL 6. I have tried this way and hit wall. C support for MySQL is very limited on the web.

Now I am looking for C++ option. I am new to C++ and my C is rusty.

jobs
Junior Poster in Training
58 posts since Jan 2007
Reputation Points: 10
Solved Threads: 0
 

I would regard http://mysql.com/ as definitive.
Did you check there?

Salem
Posting Sage
Team Colleague
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953
 

hiiiiiiiiiiii

which is the biggest data type supportd by mysql???
how shud i use scanf wit "long double"....wat is the %_????

akand
Newbie Poster
20 posts since Jun 2010
Reputation Points: 10
Solved Threads: 1
 

would you starighten your question? Do you need to get started to C++ and MySQL or MySQL++ wrapper? In case of the first you have at least three choices: MySQL Connector C++, MySQL++ or Pocco libraries with ODBC. For the latter, what do you want specifically?

evstevemd
Senior Poster
3,713 posts since Jun 2007
Reputation Points: 462
Solved Threads: 392
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You