Pon*_*ros 4 c++ mysql mysql-connector
我有一个用 C++ 编写的 MySQL 客户端。我想按照此处所述启用 MultipleStatement 选项,当然对于 C++ 而言:
http://dev.mysql.com/doc/refman/5.0/en/c-api-multiple-queries.html
在谷歌上找不到这个是不可能的。也无法找到 C++/Connector 的任何文档。这很令人沮丧。
如果有人知道我的问题的任何解决方案或任何非常有帮助的文档页面。
谢谢
这对我有用:
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));
Run Code Online (Sandbox Code Playgroud)
问候,