mirror of
https://github.com/pocoproject/poco.git
synced 2025-11-09 15:53:56 +01:00
small sample tidy up
This commit is contained in:
@@ -15,9 +15,6 @@
|
|||||||
// prior written permission from Applied Informatics.
|
// prior written permission from Applied Informatics.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
#include "Poco/SharedPtr.h"
|
|
||||||
#include "Poco/Data/SessionFactory.h"
|
|
||||||
#include "Poco/Data/Session.h"
|
#include "Poco/Data/Session.h"
|
||||||
#include "Poco/Data/SQLite/Connector.h"
|
#include "Poco/Data/SQLite/Connector.h"
|
||||||
#include <vector>
|
#include <vector>
|
||||||
@@ -98,3 +95,4 @@ int main(int argc, char** argv)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -65,19 +65,16 @@ int main(int argc, char** argv)
|
|||||||
// print all column names
|
// print all column names
|
||||||
for (std::size_t col = 0; col < cols; ++col)
|
for (std::size_t col = 0; col < cols; ++col)
|
||||||
{
|
{
|
||||||
std::cout << rs.columnName(col) << std::endl;
|
std::cout << rs.columnName(col) << "\t\t";
|
||||||
}
|
|
||||||
// iterate over all rows and columns
|
|
||||||
bool more = rs.moveFirst();
|
|
||||||
while (more)
|
|
||||||
{
|
|
||||||
for (std::size_t col = 0; col < cols; ++col)
|
|
||||||
{
|
|
||||||
std::cout << rs[col].convert<std::string>() << " ";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::cout << std::endl;
|
std::cout << std::endl;
|
||||||
more = rs.moveNext();
|
std::cout << "-----------------------------------" << std::endl;
|
||||||
}
|
|
||||||
|
// iterate over all rows and print the data
|
||||||
|
RecordSet::Iterator it = rs.begin();
|
||||||
|
RecordSet::Iterator end = rs.end();
|
||||||
|
for (; it != end; ++it) std::cout << *it;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user