@Override
	public BankInfo getBankInfo(Bank bank) throws DAOException {
		BankInfo bankInfo = new BankInfo();

		BaseDAO baseDAO = new BaseDAOImpl();
		try (Connection conn = baseDAO.openConnection()) {
			PreparedStatement stmtClientsNum = conn.prepareStatement("SELECT COUNT(ID) AS TOTAL FROM CLIENTS");
			PreparedStatement stmtAccSum = conn.prepareStatement("SELECT SUM(BALANCE) AS TOTAL_BAL FROM ACCOUNTS;");
			ResultSet resultSet = stmtClientsNum.executeQuery();
			if (resultSet == null || !resultSet.next()) {
				throw new DAOException("Can't calculate total number of clients");
			}
			bankInfo.setNumberOfClients(resultSet.getInt(1));
			stmtClientsNum.close();

			resultSet = stmtAccSum.executeQuery();
			if (resultSet == null || !resultSet.next()) {
				throw new DAOException("Can't calculate sum of all accounts of clients");
			}
			bankInfo.setTotalAccountSum(resultSet.getDouble(1));

			if (resultSet != null) { resultSet.close(); }
			if (stmtAccSum != null) { stmtAccSum.close(); }

			List<Client> clients = ServiceFactory.getClientDAO().getAllClients(bank);
			Map<String, List<Client>> clientsByCity = new TreeMap<>();
			for (Client client : clients) {
				if (!clientsByCity.containsKey(client.getCity())) {
					clientsByCity.put(client.getCity(), new ArrayList<Client>());
				}
				clientsByCity.get(client.getCity()).add(client);
			}

			bankInfo.setClientsByCity(clientsByCity);
		} catch (SQLException e) {
			e.printStackTrace();
		} finally {
			baseDAO.closeConnection();
		}
		return bankInfo;
	}