MySQL Forums
Forum List  »  Connector/C++

ResultSet memory cleanup
Posted by: Arvydas Staloncius
Date: February 03, 2011 05:09AM

Good day,

From documentation it's unclear when "ResultSet* Statement::executeQuery" function's returned ResultSet should be deleted. For example, should ResultSet be deleted after every executeQuery call?

sql::Statement* stmt = 0;
sql::ResultSet* res = 0;

// ...

for (unsigned short i = 0; i < 50; i++)
{
res = stmt->executeQuery("SELECT * FROM table1;");
while (res->next())
{
// ...
}
delete res;
res = 0;
}

Options: ReplyQuote


Subject
Views
Written By
Posted
ResultSet memory cleanup
2442
February 03, 2011 05:09AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.