template_utils.cc

00001 
00002 /*
00003  * Template program for utils package to be compiled with Makefile.utils
00004  *
00005  * Generated by eyedbodl at Tue Aug 14 18:04:25 2007
00006  */
00007 
00008 #include <iostream>
00009 #include "utils.h"
00010 
00011 int
00012 main(int argc, char *argv[])
00013 {
00014   eyedb::init(argc, argv);
00015   utils::init();
00016 
00017   if (argc != 2) {
00018     std::cerr << "usage: " << argv[0] << " <dbname>" << std::endl;
00019     return 1;
00020   }
00021 
00022   eyedb::Exception::setMode(eyedb::Exception::ExceptionMode);
00023 
00024   try {
00025     eyedb::Connection conn;
00026 
00027     conn.open();
00028 
00029     utilsDatabase db(argv[1]);
00030     db.open(&conn, eyedb::Database::DBRW);
00031 
00032     db.transactionBegin();
00033 
00034     // ----------------------------
00035     // perform your operations here
00036     // ----------------------------
00037 
00038     db.transactionCommit();
00039 
00040     db.close();
00041   }
00042   catch(eyedb::Exception &e) {
00043     std::cerr << e << std::endl;
00044     return 1;
00045   }
00046 
00047   utils::release();
00048   eyedb::release();
00049 
00050   return 0;
00051 }

Generated on Mon Dec 22 18:16:11 2008 for eyedb by  doxygen 1.5.3