0

我怎样才能得到查询执行的结果 - select count (*) from myTable?代码是:

... 
oc::Statement* stmt = 
    m_cConnection->createStatement(select count (*) from myTable);

oc::ResultSet* res = stmt->executeQuery();
...

如何获得行数的值res

4

1 回答 1

1

写吧

cout << res->getString(1) << endl;

或者

cout << "\t... MySQL counts: " << res->getInt(1) << endl;
于 2014-07-10T08:43:32.193 回答