mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-24 17:30:44 +02:00
MongoDB sample build files
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user