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
MySQL also supports the execution of a string containing multiple statements separated by semicolon ( ; ) characters. This capability is enabled by special options that are specified either when you connect to the server with mysql_real_connect() or after connecting by calling mysql_set_server_option() .
MySQL Connector/C++ is a library for applications written in C or C++ that communicate with MySQL database servers. Version 8.0 of Connector/C++ implements three different APIs which can be used by applications: The new X DevAPI for applications written in C++.
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,
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With