Well it looks like there is no info on google. I found what was the problem.
as SJuan76 said each call to createStatement and to executeQuery is a new object
So i started to do a lot of tryes and i figure out of the following
- Use createStatement just once
- Before deleting Result check if it's open and close
- Delete Respuesta
- Only delete con and Query at the end of the program auto_ptr(is your friend sometimes)
So the code to get the "forever running" program to use always the same memory shoud look like this
sql::Statement *Query;
sql::ResulSet *Result;
Query = con->createStatement();
while(1){
if(!Result->isClosed()) Result->close();
delete Result;
Result = Query->executeQuery("SELECT `Some` FROM `Table` LIMIT 1");
Result->next();
cout << "console message..." << endl;
}