dbTalk Databases Forums  

Destruction of the Connection fails

mailing.database.mysql-plusplus mailing.database.mysql-plusplus


Discuss Destruction of the Connection fails in the mailing.database.mysql-plusplus forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
AT
 
Posts: n/a

Default Destruction of the Connection fails - 06-16-2006 , 03:32 AM







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 =3D BdParam::getConnexion(); // see later: I explain=
how
// to
connect

// Creation de la requete =E0 partir de la connexion
Query query =3D conn=2Equery();
query << "select BAL_LAT "
<< "from BALISE "
<< "where BAL_PK_NOM_BALISE =3D '" << arNomBase << "'";
=20
// execution de la requete
Result res =3D query=2Estore();

cout<<"1"<<endl;

if (res=2Esize() > 0) {

Row row =3D res=2Eat(0);

double l =3D row=2Eat(0);

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

=2E=2E=2E=2E
-----------------------------------
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=3DConnection(use_exceptions);

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

=20
BdParam::con=2Econnect("database",
"host",
"user",
"password");
return BdParam::con;
}

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

Nicolas


This message contains information that may be privileged or confidential=
and is the property of the Capgemini Group=2E It is intended only for the=
person to whom it is addressed=2E If you are not the intended recipient, =
you are not authorized to read, print, retain, copy, disseminate, =
distribute, or use this message or any part thereof=2E If you receive this=
message in error, please notify the sender immediately and delete all =
copies of this message=2E


--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw


Reply With Quote
  #2  
Old   
AT
 
Posts: n/a

Default Re: Destruction of the Connection fails - 06-16-2006 , 09:12 PM






Rieu Nicolas wrote:
Quote:
I've got the same problem than mazah_82
See my response to him.

Quote:
How do I create the connection to the database ? :
Have you completely overlooked the examples and the user manual?

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.