From 84f9ce9150abfb5f4424d8e94fefa932af3172fa Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Fri, 2 Sep 2011 14:15:46 +0200 Subject: Add infrastructure for oracle development testing and implement native test --- libcommon/common/common.cxx | 14 ++++++++++++++ libcommon/common/config.h.in | 1 + libcommon/common/makefile | 3 +++ 3 files changed, 18 insertions(+) (limited to 'libcommon') diff --git a/libcommon/common/common.cxx b/libcommon/common/common.cxx index 384d945..d09c14b 100644 --- a/libcommon/common/common.cxx +++ b/libcommon/common/common.cxx @@ -22,6 +22,9 @@ #elif defined(DATABASE_PGSQL) # include # include +#elif defined(DATABASE_ORACLE) +# include +# include #else # error unknown database #endif @@ -37,6 +40,8 @@ namespace mysql = odb::mysql; namespace sqlite = odb::sqlite; #elif defined(DATABASE_PGSQL) namespace pgsql = odb::pgsql; +#elif defined(DATABASE_ORACLE) +namespace oracle = odb::oracle; #endif auto_ptr @@ -60,6 +65,8 @@ create_database (int& argc, sqlite::database::print_usage (cerr); #elif defined(DATABASE_PGSQL) pgsql::database::print_usage (cerr); +#elif defined(DATABASE_ORAClE) + oracle::database::print_usage (cerr); #endif exit (0); @@ -107,6 +114,13 @@ create_database (int& argc, f.reset (new pgsql::connection_pool_factory (max_connections)); db.reset (new pgsql::database (argc, argv, false, "", f)); +#elif defined(DATABASE_ORACLE) + auto_ptr f; + + if (max_connections != 0) + f.reset (new oracle::connection_pool_factory (max_connections)); + + db.reset (new oracle::database (argc, argv, false, 0, f)); #endif return db; diff --git a/libcommon/common/config.h.in b/libcommon/common/config.h.in index dba0b12..b7cc545 100644 --- a/libcommon/common/config.h.in +++ b/libcommon/common/config.h.in @@ -12,6 +12,7 @@ #undef DATABASE_MYSQL #undef DATABASE_SQLITE #undef DATABASE_PGSQL +#undef DATABASE_ORACLE #undef HAVE_TR1_MEMORY #undef LIBCOMMON_STATIC_LIB diff --git a/libcommon/common/makefile b/libcommon/common/makefile index 326f1f6..885b55d 100644 --- a/libcommon/common/makefile +++ b/libcommon/common/makefile @@ -58,6 +58,9 @@ endif ifeq ($(db_id),pgsql) @echo '#define DATABASE_PGSQL 1' >>$@ endif +ifeq ($(db_id),oracle) + @echo '#define DATABASE_ORACLE 1' >>$@ +endif @echo '#define HAVE_TR1_MEMORY 1' >>$@ @echo '' >>$@ @echo '#endif /* LIBCOMMON_COMMON_CONFIG_H */' >>$@ -- cgit v1.1