aboutsummaryrefslogtreecommitdiff
path: root/libcommon/common
diff options
context:
space:
mode:
Diffstat (limited to 'libcommon/common')
-rw-r--r--libcommon/common/common.cxx14
-rw-r--r--libcommon/common/config.h.in1
-rw-r--r--libcommon/common/makefile3
3 files changed, 18 insertions, 0 deletions
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 <odb/pgsql/database.hxx>
# include <odb/pgsql/connection-factory.hxx>
+#elif defined(DATABASE_ORACLE)
+# include <odb/oracle/database.hxx>
+# include <odb/oracle/connection-factory.hxx>
#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<database>
@@ -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<oracle::connection_factory> 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 */' >>$@