private static HashMap<String, String> getParams(Node databases, String dbId) {
		HashMap<String, String> params = new HashMap<String, String>();
		try {
			ConfigParser cp = ConfigParser.getParser(databases);
			String id = "";
			Element db = null;
			if (dbId != null && !dbId.isEmpty()) {
				id = dbId;
				db = cp.getElementWithAttribute("id", id, "database");
			} else if (((Element) databases).hasAttribute("main")) {
				id = ((Element) databases).getAttribute("main");
				db = cp.getElementWithAttribute("id", id, "database");
			} else {
				db = cp.getElementAt("database", 0);
			}

			HashMap<String, String> ret = new HashMap<String, String>();
			cp.setNode((Element) db);
			ret.put("endpoint",
					cp.getElementAt("endpoint", 0).getAttribute("uri"));
			cp.setNode((Element) db);
			try {
				ret.put("user", cp.getElementAt("user", 0)
						.getAttribute("value"));
				cp.setNode((Element) db);
				ret.put("pwd", cp.getElementAt("pwd", 0).getAttribute("value"));
				cp.setNode((Element) db);
			} catch (Exception e) {
				Logger.getGlobal().info("No User and PWD is set - correct?");
			}
			ret.put("connectionType", db.getAttribute("type").toUpperCase());
			switch (ConnectionType.valueOf(db.getAttribute("type")
					.toUpperCase())) {
			case CURL:
				ret.putAll(getCurlParams((Node) db));
				break;
			case IMPL:
				break;
			case IMPLCURL:
				ret.putAll(getImplCurlParams((Node) db));
				break;
			}
			params.putAll(ret);
		} catch (SAXException | IOException | ParserConfigurationException e) {
			LogHandler.writeStackTrace(Logger.getGlobal(), e, Level.SEVERE);
			return null;
		}
		return params;
	}