MySQL C++ Connector UPDATE
MySQL C++ Connector UPDATE
我在使用 MySQL C++ 连接器时遇到问题...我的问题是我有一个查询:UPDATE characters SET name = 'myNameIs' WHERE characregistra = 'MyguidIs'
字符是表,命名一列,字符也是。当我在字符列中找到值"MyguisIs"时,我尝试将 myNameIs 值放入名称中。它可以工作,但如果没有try{]catch{],它就会崩溃。我试图用sql::SQLException得到错误,但没办法,打印什么都没有...提前谢谢。
编辑:忘记输入代码:
void renameCharac(std::string guid, std::string pseudo)
{
try{
sql::Statement *declaration;
declaration = connection->createStatement(); // Connection is declared
declaration->executeQuery("UPDATE characters SET name = '" + pseudo + "' WHERE characregistra = '" + guid + "'");
delete declaration;
}
catch (sql::SQLException e)
{
std::cout << e.what();
}
}
最后我是这样做的:
void renameCharac(std::string guid, std::string pseudo)
{
sql::Statement *declaration;
declaration = connection->createStatement();
declaration->executeUpdate("UPDATE characters SET name = '" + pseudoChoisi + "' WHERE characregistra = '" + guid + "'");
delete declaration;
}
它有效。
相关文章:
- mysql C++ connector [mysql-connector-c++-8.0.19-linux-glibc2
- 在 MySQL/Connector C++中使用 SQL 联接
- 如何在MySQL Connector/C++ 8.0中使用DATETIME?
- Visual Studio Professional 2013, Update 5, "No Target Architecture"
- 如何使用MySQL Connector and Make设置C++项目
- C++ - Mysql connector
- 对目录进行更改后,如何"update" diretory_iterator?
- 如何使C++Mysql Connector与Visual Studio 2019一起使用?
- Windows Creators Update 會厮敗舊的C++應用程序
- QT4:在所有qgraphicsItem上的单个qgraphictem rapers paint()上的update()
- 使用 MySQL Connector C++ 链接 mysqlcppconn-static 时出现问题
- Windows 10 Creators Update(1703)崩溃了我们的应用程序
- MySql connector-c++不会在QtCreator中链接,但在Raspberry pi3上本地工作正常
- C++ Qt GUI update
- 当Bool值在UPDATE()方法中更改时,只有一次呼叫函数
- 尝试在Windows上构建MySQL-Connector-CPP
- 在Windows上的DEBUG,VS2K17上的调试中的MySQL-Connector C 应用程序
- 我正在使用 mysql-connector-c++ 1.1.9,但我想通过套接字而不是 tcp 连接到 mysql 数据库
- vtk c++ update contour from contourfilter
- MySQL C++ Connector UPDATE