MaintenanceDao and DBConnector modified to open and close connections.