MongoDB sample build files

This commit is contained in:
aleks-f
2013-03-12 22:58:22 -05:00
parent bf0bc11878
commit daef0aa403
31 changed files with 3832 additions and 11 deletions

View File

@@ -48,14 +48,6 @@ using Poco::Data::Statement;
using Poco::Data::RecordSet;
struct Person
{
std::string name;
std::string address;
int age;
};
int main(int argc, char** argv)
{
// create a session

View File

@@ -108,10 +108,10 @@ int main(int argc, char** argv)
// drop sample table, if it exists
session << "DROP TABLE IF EXISTS Simpsons", now;
// (re)create table
session << "CREATE TABLE Simpsons (Name VARCHAR(30), Address VARCHAR, Age INTEGER(3), Birthday DATE)", now;
// insert some rows
DateTime hd(1956, 3, 1);
session << "INSERT INTO Simpsons VALUES('Homer Simpson', 'Springfield', 42, ?)", use(hd), now;
@@ -121,7 +121,7 @@ int main(int argc, char** argv)
session << "INSERT INTO Simpsons VALUES('Bart Simpson', 'Springfield', 12, ?)", use(hd), now;
hd.assign(1982, 5, 9);
session << "INSERT INTO Simpsons VALUES('Lisa Simpson', 'Springfield', 10, ?)", use(hd), now;
// create a statement and print the column names and data as HTML table
HTMLTableFormatter tf;
Statement stmt = (session << "SELECT * FROM Simpsons", format(tf), now);