diff --git a/lib/SimpleSAML/Database.php b/lib/SimpleSAML/Database.php
index 818ec2fe5f45d967c3ab6b6fdeb5289f53929b54..2e338f1bedd047c240c8beb65f2062cedf90d551 100644
--- a/lib/SimpleSAML/Database.php
+++ b/lib/SimpleSAML/Database.php
@@ -125,8 +125,8 @@ class Database {
 			$db->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);
 
 			return $db;
-		} catch(PDOException $e){
-			throw new Exception("Database error: ". $e->getMessage());
+		} catch(\PDOException $e){
+			throw new \Exception("Database error: ". $e->getMessage());
 		}
 	}
 
@@ -186,8 +186,8 @@ class Database {
 			$query->execute();
 
 			return $query;
-		} catch (PDOException $e){
-			throw new Exception("Database error: ". $e->getMessage());
+		} catch (\PDOException $e){
+			throw new \Exception("Database error: ". $e->getMessage());
 		}
 	}
 
@@ -209,8 +209,8 @@ class Database {
 			$query = $db->exec($stmt);
 
 			return $query;
-		} catch (PDOException $e){
-			throw new Exception("Database error: ". $e->getMessage());
+		} catch (\PDOException $e){
+			throw new \Exception("Database error: ". $e->getMessage());
 		}
 	}