Get history for a specific database ID

@param id ID of history entry
@return History entry
325659
public History getHistoryForID(int id) {
        History history = null;
        PreparedStatement query = null;
        ResultSet results = null;

        try (Connection sqlConnection = sqlService.getConnection()) {
            query = sqlConnection.prepareStatement("SELECT * FROM " + Constants.DB_TABLE_HISTORY +
                                                       " WHERE " + Constants.GENERIC_ID + "=?");
            query.setInt(1, id);

            logger.info("Query: {}", query.toString());
            results = query.executeQuery();
            if (results.next()) {
                history = historyFromSQLResult(results, true, ScriptService.getInstance().getScripts(Constants.SCRIPT_TYPE_HISTORY));
            }
            query.close();
        } catch (Exception e) {
        } finally {
            try {
                if (results != null) {
                    results.close();
                }
            } catch (Exception e) {
            }
            try {
                if (query != null) {
                    query.close();
                }
            } catch (Exception e) {
            }
        }
        return history;
    }
1003265
private function getHistoryId($history_data_area)
    {
        $id = $history_data_area->find('a', 0)->href;
        $id = explode('/', $id);

        return $id[4];
    }
1358438
@Override
	public List<CommandHistoryItem> getCommandHistory(
			int pageNumber,
			String applicationName,
			int itemsPerPage,
			String sortingCriteria,
			String sortingOrder ) {

		if( pageNumber < 1 )
			pageNumber = 1;

		this.logger.fine( "Request: get the history of commands execution (page = " + pageNumber + ")." );
		return this.manager.commandsMngr().getHistory(
				(pageNumber -1) * itemsPerPage,
				itemsPerPage,
				sortingCriteria,
				sortingOrder,
				applicationName );
	}
309216
def channels_history(self, room_id, **kwargs):
        """"""
        return self.__call_api_get('channels.history', roomId=room_id, kwargs=kwargs)
215386
public OvhConferenceHistory billingAccount_conference_serviceName_histories_id_GET(String billingAccount, String serviceName, Long id) throws IOException {
		String qPath = "/telephony/{billingAccount}/conference/{serviceName}/histories/{id}";
		StringBuilder sb = path(qPath, billingAccount, serviceName, id);
		String resp = exec(qPath, "GET", sb.toString(), null);
		return convertTo(resp, OvhConferenceHistory.class);
	}
1029318
public User getUser(String id) {
        return db.query("SELECT * FROM Users WHERE id = ?",
                new ResultSetExtractor<User>() {
                    public User extractData(ResultSet rs)
                            throws SQLException {
                        if (rs.next()) {
                            return getUser(rs);
                        } else {
                            return null;
                        }
                    }
                },
                Integer.parseInt(id));
    }
691776
public BoxRequestsComment.GetCommentInfo getInfoRequest(String id) {
        BoxRequestsComment.GetCommentInfo request = new BoxRequestsComment.GetCommentInfo(id, getCommentInfoUrl(id), mSession);
        return request;
    }
377046
public Integer getNextIDSeq(final String id) {
        Validate.notNull(id, "ID cannot be null");
        Integer count = this.idCounts.get(id);
        if (count == null) {
            count = Integer.valueOf(1);
        }
        return count;
    }
461409
public function historyAction($id = null)
    {
        $request = $this->getRequest();
        $id = $request->get($this->admin->getIdParameter());

        $object = $this->admin->getObject($id);

        if (!$object) {
            throw $this->createNotFoundException(sprintf('unable to find the object with id: %s', $id));
        }

        $this->admin->checkAccess('history', $object);

        $manager = $this->get('sonata.admin.audit.manager');

        if (!$manager->hasReader($this->admin->getClass())) {
            throw $this->createNotFoundException(
                sprintf(
                    'unable to find the audit reader for class : %s',
                    $this->admin->getClass()
                )
            );
        }

        $reader = $manager->getReader($this->admin->getClass());

        $revisions = $reader->findRevisions($this->admin->getClass(), $id);

        // NEXT_MAJOR: Remove this line and use commented line below it instead
        $template = $this->admin->getTemplate('history');
        // $template = $this->templateRegistry->getTemplate('history');

        return $this->renderWithExtraParams($template, [
            'action' => 'history',
            'object' => $object,
            'revisions' => $revisions,
            'currentRevision' => $revisions ? current($revisions) : false,
        ], null);
    }
570636
private static Chronology of0(String id) {
        Chronology chrono = CHRONOS_BY_ID.get(id);
        if (chrono == null) {
            chrono = CHRONOS_BY_TYPE.get(id);
        }
        return chrono;
    }
634700
public User getUserById(int id) {
		for (User u : users)
			if (u.getId() == id)
				return u;
		return null;
	}
1031124
public java.util.List<HistoryRecordEntry> getHistoryRecords() {
        if (historyRecords == null) {
            historyRecords = new com.amazonaws.internal.SdkInternalList<HistoryRecordEntry>();
        }
        return historyRecords;
    }
1166934
def namedb_get_history_rows( cur, history_id, offset=None, count=None, reverse=False ):
    
    ret = []
    if not reverse:
        select_query = "SELECT * FROM history WHERE history_id = ? ORDER BY block_id ASC, vtxindex ASC"
    else:
        select_query = "SELECT * FROM history WHERE history_id = ? ORDER BY block_id DESC, vtxindex DESC"

    args = (history_id,)

    if count is not None:
        select_query += " LIMIT ?"
        args += (count,)

        if offset is not None:
            select_query += " OFFSET ?"
            args += (offset,)

    select_query += ";"

    history_rows = namedb_query_execute( cur, select_query, args)
    for r in history_rows:
        rd = dict(r)
        ret.append(rd)

    return ret
52456
public TResult queryForId(long id) {
		String where = getPkWhere(id);
		String[] whereArgs = getPkWhereArgs(id);
		TResult result = userDb.query(getTableName(), table.getColumnNames(),
				where, whereArgs, null, null, null);
		prepareResult(result);
		return result;
	}
1145201
protected <T extends HistoryEvent> T findInCache(Class<T> type, String id) {
    return Context.getCommandContext()
      .getDbEntityManager()
      .getCachedEntity(type, id);
  }
386952
@RequestMapping(value = "/api/history/{profileIdentifier}/{id}", method = RequestMethod.GET)
    public
    @ResponseBody
    HashMap<String, Object> getHistoryForId(Model mode, @PathVariable String profileIdentifier, @PathVariable Integer id,
                                            @RequestParam(value = "format", required = false) String formatted) {
        HashMap<String, Object> returnData = new HashMap<String, Object>();
        History history = HistoryService.getInstance().getHistoryForID(id);
        if (formatted != null) {
            try {
                if (formatted.equals("formattedAll")) {
                    history.setFormattedResponseData(history.getResponseData());
                    history.setFormattedOriginalResponseData(history.getOriginalResponseData());
                } else if (formatted.equals("formattedModified")) {
                    history.setFormattedResponseData(history.getResponseData());
                } else if (formatted.equals("formattedOriginal")) {
                    history.setFormattedOriginalResponseData(history.getOriginalResponseData());
                }
                returnData.put("history", history);
            } catch (Exception e) {
                e.printStackTrace();
            }
        } else {
            returnData = new HashMap<String, Object>();
            returnData.put("history", HistoryService.getInstance().getHistoryForID(id));
        }

        return returnData;
    }
1067843
def get_by_id(id, with_estimate = 1)
      params = { :id => id, :with_estimate => with_estimate }
      requires params
      DataSift.request(:GET, 'historics/get', @config, params)
    end