Пример #1
0
  @Override
  public String getExplainResult(String connectionToken, String query)
      throws IllegalArgumentException, DatabaseConnectionException {
    ConnectionManager connMgr = new ConnectionManager();
    HttpServletRequest request = this.getThreadLocalRequest();

    String clientIP = ConnectionInfo.remoteAddr(request);
    String userAgent = request.getHeader("User-Agent");

    ItemData id;

    id = new ItemData(connMgr.getConnection(connectionToken, clientIP, userAgent));

    return id.getExplainResult(query);
  }
Пример #2
0
  @Override
  public String getItemData(String connectionToken, int item, ITEM_TYPE type, int count)
      throws IllegalArgumentException, DatabaseConnectionException, PostgreSQLException {

    ConnectionManager connMgr = new ConnectionManager();
    HttpServletRequest request = this.getThreadLocalRequest();

    String clientIP = ConnectionInfo.remoteAddr(request);
    String userAgent = request.getHeader("User-Agent");

    ItemData id;

    id = new ItemData(connMgr.getConnection(connectionToken, clientIP, userAgent));

    try {
      return id.getData(item, type, count);
    } catch (SQLException e) {
      throw new PostgreSQLException(e.getMessage());
    }
  }