summaryrefslogtreecommitdiff
path: root/cpp/demo/Freeze/transform/create.cpp
diff options
context:
space:
mode:
authorMatthew Newhook <matthew@zeroc.com>2015-03-18 12:58:16 -0230
committerMatthew Newhook <matthew@zeroc.com>2015-03-18 12:58:16 -0230
commit9b7668c7c92cf9cb311fe444cdddb489cd2a219d (patch)
tree5016567c58c81f5654e9d01935e199c6bf4761d2 /cpp/demo/Freeze/transform/create.cpp
parentVS add-in & build updates: (diff)
downloadice-9b7668c7c92cf9cb311fe444cdddb489cd2a219d.tar.bz2
ice-9b7668c7c92cf9cb311fe444cdddb489cd2a219d.tar.xz
ice-9b7668c7c92cf9cb311fe444cdddb489cd2a219d.zip
Removed demos.
Moved demoscript to distribution.
Diffstat (limited to 'cpp/demo/Freeze/transform/create.cpp')
-rw-r--r--cpp/demo/Freeze/transform/create.cpp62
1 files changed, 0 insertions, 62 deletions
diff --git a/cpp/demo/Freeze/transform/create.cpp b/cpp/demo/Freeze/transform/create.cpp
deleted file mode 100644
index 51e5a541d08..00000000000
--- a/cpp/demo/Freeze/transform/create.cpp
+++ /dev/null
@@ -1,62 +0,0 @@
-// **********************************************************************
-//
-// Copyright (c) 2003-2015 ZeroC, Inc. All rights reserved.
-//
-// This copy of Ice is licensed to you under the terms described in the
-// ICE_LICENSE file included in this distribution.
-//
-// **********************************************************************
-
-#include <Ice/Ice.h>
-#include <Freeze/Freeze.h>
-#include <Contacts.h>
-
-using namespace std;
-using namespace Demo;
-using namespace Freeze;
-
-class Create : public Ice::Application
-{
-public:
-
- virtual int run(int, char*[]);
-};
-
-int main(int argc, char* argv[])
-{
- Create app;
- return app.main(argc, argv);
-}
-
-int
-Create::run(int, char*[])
-{
- const string names[] = { "don", "ed", "frank", "gary", "arnold", "bob", "carlos" };
- const string phoneNumbers[] = { "(777)777-7777", "(666)666-6666", "(555)555-5555 x123",
- "(444)444-4444", "(333)333-3333 x1234", "(222)222-2222", "(111)111-1111" };
- const size_t size = 7;
-
-
- ConnectionPtr connection = createConnection(communicator(), "db");
- Contacts contacts(connection, "contacts");
-
-
- //
- // Create a bunch of contacts within one transaction, and commit it
- //
-
- TransactionHolder txh(connection);
- for(size_t i = 0; i < size; ++i)
- {
- ContactData data;
- data.phoneNumber = phoneNumbers[i];
-
- contacts.put(Contacts::value_type(names[i], data));
- }
-
- txh.commit();
-
- cout << size << " contacts were successfully created or updated" << endl;
-
- return 0;
-}