MySQL C++/Connector setClientOption to support multiple statements

c++, mysql, mysql-connector

Solution

This worked for me:

sql::ConnectOptionsMap connection_properties;

connection_properties["hostName"]=sql::SQLString("localhost");
connection_properties["userName"]=sql::SQLString("username");
connection_properties["password"]=sql::SQLString("password");
connection_properties["CLIENT_MULTI_STATEMENTS"]=(true);

sql::Driver * driver = get_driver_instance();
std::unique_ptr<sql::Connection> con(driver->connect(connection_properties));

Regards,

Problem

I have a MySQL client written with C++. I want to enable the MultipleStatement option as described here, but for the C++ of course: http://dev.mysql.com/doc/refman/5.0/en/c-api-multiple-queries.html It is impossible to find this on google. Also it is impossible to find any documentation for the C++/Connector. This is pretty frustrating. If anyone knows any solution for my problem or any documentation page that would be very very helpful. Thank you

Original source