small sample tidy up

This commit is contained in:
Aleksandar Fabijanic
2007-09-24 01:37:31 +00:00
parent 228d48ad14
commit 8506aad3ae
2 changed files with 13 additions and 18 deletions

View File

@@ -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;
} }

View File

@@ -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;
} }