2 messages in com.mysql.lists.plusplusDestruction of the Connection fails
FromSent OnAttachments
Rieu Nicolas16 Jun 2006 01:24 
Warren Young16 Jun 2006 19:11 
Subject:Destruction of the Connection fails
From:Rieu Nicolas (nico@capgemini.com)
Date:06/16/2006 01:24:31 AM
List:com.mysql.lists.plusplus

Hello, I've got the same problem than mazah_82

At the end of the block, the program doesn't terminate correctly: The program displays (cout) 1 2 But it stops before displaying 3

Here is my code:

-------------------------------- Connection & conn = BdParam::getConnexion(); // see later: I explain how // to connect

// Creation de la requete à partir de la connexion Query query = conn.query(); query << "select BAL_LAT " << "from BALISE " << "where BAL_PK_NOM_BALISE = '" << arNomBase << "'";

// execution de la requete Result res = query.store();

cout<<"1"<<endl;

if (res.size() > 0) {

Row row = res.at(0);

double l = row.at(0);

cout<<"2"<<endl; } cout<<"3"<<endl;

....

----------------------------------- How do I create the connection to the database ? :

I've got a static class "BdParam", which defines a static Connection (con)

----------------------------------- // declaration of the connection Connection BdParam::con=Connection(use_exceptions);

// method implementing the connection Connection & BdParam::getConnexion() {

BdParam::con.connect("database", "host", "user", "password"); return BdParam::con; }

Is anyone able to notice I made a mistake or not? Thanks a lot for replying, please.

Nicolas