diff --git a/MAC/APL/MainCU/src/MACScheduler/MACScheduler.cc b/MAC/APL/MainCU/src/MACScheduler/MACScheduler.cc
index 978c87326175cd6635cebf9fa3107155b8713ffd..7ac95d6472d0ee691cdf2cad57fb9086e13f2206 100644
--- a/MAC/APL/MainCU/src/MACScheduler/MACScheduler.cc
+++ b/MAC/APL/MainCU/src/MACScheduler/MACScheduler.cc
@@ -252,17 +252,74 @@ GCFEvent::TResult MACScheduler::initial_state(GCFEvent& event, GCFPortInterface&
 
 		// Try to connect to the SAS database.
 		ParameterSet* pParamSet = globalParameterSet();
-		string username	= pParamSet->getString("OTDBusername");
-		string DBname 	= pParamSet->getString("OTDBdatabasename");
-		string password	= pParamSet->getString("OTDBpassword");
-		string hostname	= pParamSet->getString("OTDBhostname");
+        std::string username;
+        try
+        {
+            username = pParamSet->getString("OTDBusername");
+        }
+        catch(LOFAR::APSException& ex)
+        {
+            LOG_ERROR_STR("MACScheduler code caught an exception while trying to "
+                          "read the OTDB database user name from its configuration file:  "
+                          << ex.what());
+            throw(ex);
+        }
+        std::string DBname;
+        try
+        {
+            DBname = pParamSet->getString("OTDBdatabasename");
+        }
+        catch(LOFAR::APSException& ex)
+        {
+            LOG_ERROR_STR("MACScheduler code caught an exception while trying to "
+                          "read the OTDB database name from its configuration file:  "
+                          << ex.what());
+            throw(ex);
+        }
+        std::string password;
+        try
+        {
+            password = pParamSet->getString("OTDBpassword");
+        }
+        catch(LOFAR::APSException& ex)
+        {
+            LOG_ERROR_STR("MACScheduler code caught an exception while trying to "
+                          "read the OTDB database password from its configuration file:  "
+                          << ex.what());
+            throw(ex);
+        }
+        std::string hostname;
+        try
+        {
+            hostname = pParamSet->getString("OTDBhostname");
+        }
+        catch(LOFAR::APSException& ex)
+        {
+            LOG_ERROR_STR("MACScheduler code caught an exception while trying to "
+                          "read the OTDB database server host name from its configuration file:  "
+                          << ex.what());
+            throw(ex);
+        }
+        std::string port;
+        try
+        {
+            port = pParamSet->getString("OTDBport");
+        }
+        catch(LOFAR::APSException& ex)
+        {
+            LOG_ERROR_STR("MACScheduler code caught an exception while trying to "
+                          "read the OTDB database server port from its configuration file:  "
+                          << ex.what());
+            throw(ex);
+        }
 
 		LOG_INFO_STR ("Trying to connect to the OTDB on " << hostname);
-		itsOTDBconnection= new OTDBconnection(username, password, DBname, hostname);
+		itsOTDBconnection= new OTDBconnection(username, password, DBname, hostname, port);
 		ASSERTSTR (itsOTDBconnection, "Memory allocation error (OTDB)");
 		ASSERTSTR (itsOTDBconnection->connect(),
-					"Unable to connect to database " << DBname << " on " << hostname <<
-					" using " << username << "," << password);
+                   "Unable to connect to database " << DBname << " on " << hostname <<
+                   " port: " << port <<
+                   " using " << username << "," << password);
 		LOG_INFO ("Connected to the OTDB");
 		itsPropertySet->setValue(PN_MS_OTDB_CONNECTED, GCFPVBool(true));