我正在使用MySQL C++连接器版本1.1.0。 这是我的代码看起来像:MySQL C++连接器MySQL_Prepared_Statement :: getUpdateCount错误
PreparedStatement *pStatement;
connection->setAutoCommit(false);
pStatement = connection->prepareStatement("UPDATE records "
"SET is_processed = ? "
"WHERE id = ?");
//LOOP BEGIN
pStatement->setInt(1, is_processed);
pStatement->setString(2, record_id);
pStatement->execute();
//LOOP END
int updated_records;
try
{
updated_records = pStatement->getUpdateCount();
}
catch(SQLException&e)
{
cout << "ERROR: " << e.what();
cout << " (MySQL error code: " << e.getErrorCode();
cout << ", SQLState: " << e.getSQLState() << ")" << endl;
}
connection->commit();
connection->setAutoCommit(true);
异常与下面的输出抛出:
ERROR: MySQL_Prepared_Statement::getUpdateCount (MySQL error code: 0, SQLState:)
所以说完全没有。 getUpdateCount()
函数有什么问题?有什么方法可以获得更详细的错误报告级别?
编辑
是否有任何其他方式来获得更新的行计数用mysql C++接口?