Ankur G35 Saxena wrote:
> I am using mysql++ very lightly..connect to a DB, run a
> select/insert/update and use the result set. Now I have 2 things I
> want to do...One I want to figure how to keep the connection always on
> and be able to check if the connection has disconnected and if so,
> then connect to the db again.
Use Connection::ping(). Here's why:
http://dev.mysql.com/doc/mysql/en/mysql-ping.html
> Is it a big overhead to keep connecting every 1/2 a sec or so?
Are you asking us to guess what the results of your benchmark testing
will be? That's a poor substitute for actually doing the tests...
> Also how do I get how many filed are returned by a select * from
> query. I know how to get how many rows, but the col number and names,
> how do I get that?
Look at the value_list() and field_list() member functions. See also
the fieldinf1 and dbinfo examples.
> I have few other questions which I will send in a seperate email once
> I am alittle clear as to what I want to do.
Please avail yourself of the manual first:
http://tangentsoft.net/mysql++/doc/
Two of the questions you've already asked are already addressed there.