  | | | unsuccessful queries and lost connection | unsuccessful queries and lost connection 2007-07-25 - By Albert Sanchez
Back Hi all,
I'm programming a piece of software that continuously looks up if it has pending sql queries (UPDATE and INSERT) and executes them. I should also control if I lost the db connection or if a sql query was unsuccessful.
My question is:
in what circumstances could I lose the connection to the db and how would I realize it?
I have found in the refman a mysqlpp::BadQuery class.
Just something like this?
try { mysqlpp::Query sqlQuery = sqlConn.query(); sqlQuery << q; } catch(mysqlpp::BadQuery ex) {
}
Is there a better way to deal with errors?
I only want to know if it occurred an error, I am not interested in other stats or results.
Thanks in advance, Albert
|
|
 |