List:MySQL++« Previous MessageNext Message »
From:Warren Young Date:July 18 2005 12:05pm
Subject:Re: Connection always on and field names
View as plain text  
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.
Thread
static globals in SSQL macro expansion -> multiple definitionlinker errorsWolfram Arnold6 Jul
  • Re: static globals in SSQL macro expansion -> multiple definition linker errorsChris Frey6 Jul
    • Re: static globals in SSQL macro expansion -> multiple definitionlinker errorsWolfram Arnold6 Jul
    • Re: static globals in SSQL macro expansion -> multiple definitionlinker errorsWarren Young6 Jul
      • Re: static globals in SSQL macro expansion -> multiple definition linker errorsChris Frey6 Jul
        • Re: static globals in SSQL macro expansion -> multiple definitionlinker errorsWarren Young6 Jul
          • Re: static globals in SSQL macro expansion -> multiple definition linker errorsChris Frey7 Jul
            • Re: static globals in SSQL macro expansion -> multiple definitionlinker errorsWarren Young7 Jul
              • Re: static globals in SSQL macro expansion -> multiple definition linker errorsChris Frey8 Jul
                • Re: static globals in SSQL macro expansion -> multiple definitionlinker errorsWarren Young8 Jul
              • Unresolved External SymbolBrian Farmer14 Jul
                • Re: Unresolved External SymbolWarren Young14 Jul
                • Connection always on and field namesAnkur G35 Saxena17 Jul
                  • Re: Connection always on and field namesWarren Young18 Jul
  • Re: static globals in SSQL macro expansion -> multiple definitionlinker errorsWarren Young6 Jul