mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-27 02:53:10 +01:00
added DateTime to samples
added DateTime to samples fixed TypeHandler::prepare for AutoPtr and SharedPtr
This commit is contained in:
@@ -32,6 +32,7 @@
|
||||
|
||||
|
||||
#include "Poco/SharedPtr.h"
|
||||
#include "Poco/DateTime.h"
|
||||
#include "Poco/Data/SessionFactory.h"
|
||||
#include "Poco/Data/Session.h"
|
||||
#include "Poco/Data/RecordSet.h"
|
||||
@@ -41,6 +42,7 @@
|
||||
|
||||
|
||||
using namespace Poco::Data::Keywords;
|
||||
using Poco::DateTime;
|
||||
using Poco::Data::Session;
|
||||
using Poco::Data::Statement;
|
||||
using Poco::Data::RecordSet;
|
||||
@@ -66,11 +68,11 @@ int main(int argc, char** argv)
|
||||
session << "DROP TABLE IF EXISTS Person", now;
|
||||
|
||||
// (re)create table
|
||||
session << "CREATE TABLE Person (Name VARCHAR(30), Address VARCHAR, Age INTEGER(3))", now;
|
||||
session << "CREATE TABLE Person (Name VARCHAR(30), Address VARCHAR, Age INTEGER(3), Birthday DATE)", now;
|
||||
|
||||
// insert some rows
|
||||
session << "INSERT INTO Person VALUES('Bart Simpson', 'Springfield', 12)", now;
|
||||
session << "INSERT INTO Person VALUES('Lisa Simpson', 'Springfield', 10)", now;
|
||||
session << "INSERT INTO Person VALUES('Bart Simpson', 'Springfield', 12, ?)", use(DateTime(1980, 4, 1)), now;
|
||||
session << "INSERT INTO Person VALUES('Lisa Simpson', 'Springfield', 10, ?)", use(DateTime(1982, 5, 9)), now;
|
||||
|
||||
// a simple query
|
||||
Statement select(session);
|
||||
|
||||
Reference in New Issue
Block a user