sql::PreparedStatement *prep_stmt; prep_stmt = con->prepareStatement("UPDATE Table1 SET Col1 = ? WHERE Col2 = ?"); prep_stmt->setInt(1, 123); prep_stmt->setString(2, "value"); int rows_updated = prep_stmt->executeUpdate(); delete prep_stmt;
#includeThese header files are part of the MySQL Connector/C++ library, which you can download and install from the official MySQL website.#include