public <K, T>
	Map<K,T> executeQueryForKeyMappedList(SelectQuery<T> query, boolean sorted) throws DatabaseManagerException {
		Connection conn = null;
		ResultSet resultSet = null;
		PreparedStatement stmt = null;
		try {
			conn = connectionProvisioner.getConnection();
			stmt = query.toPreparedStatement(conn);
			logger.debug("<execute> Query [" + query.getQueryString() + "]");
			logger.debug("<execute> Setting parameters on query ...");
			stmt = query.toPreparedStatement(conn);
			logger.debug("<execute> Parameters on query was set successfully.");
			boolean executeResult = stmt.execute();
			logger.info("<execute> Query executed successfully and exited with result <" + executeResult + ">");
			resultSet = stmt.getResultSet();
			Map<K, T> resultKeyMap = query.<K>toResultMap(resultSet,sorted);
			logger.info("<execute> Post processing result set");
			query.postProcess(resultSet);
			return resultKeyMap;
		} catch (SQLException e) {
			throw new DatabaseManagerException("Error in queryKeyMappedList.", e);
		} catch (ResultMapException e) {
			throw new DatabaseManagerException("Failed to create Map as there was an error when mapping from the resultSet",e);
		} finally {
			closeResources(conn, stmt, resultSet);
		}
	}