With MySQL Connector C++, I can use the
sql::Statement::execute() function if I am going to modify the database (INSERT, UPDATE, DELETE, MERGE), or the
sql::Statement::executeQuery() function if I am going to do a simple read only query.
Supposing I do not know what is in the query, how can I choose what to do?
At the moment I just check if in the query string there are any of the INSERT, UPDATE, DELETE or MERGE tokens. But that is a far from perfect way to do it.
Is there another method to do it?
Should I just ignore the warning messages returned by MySQL when I use executeQuery() to modify the DB?