private Page<String> executeListAllValidDatasetsStatement(PreparedStatement statement, int accountId,
      int containerId, String pageToken) throws SQLException {
    ResultSet resultSet = null;
    try {
      statement.setInt(1, accountId);
      statement.setInt(2, containerId);
      statement.setString(3, pageToken);
      statement.setString(4, pageToken);
      statement.setInt(5, mySqlAccountServiceConfig.listDatasetsMaxResult + 1);
      resultSet = statement.executeQuery();
      List<String> entries = new ArrayList<>();
      String nextContinuationToken = null;
      int resultIndex = 0;
      while (resultSet.next()) {
        if (resultIndex == mySqlAccountServiceConfig.listDatasetsMaxResult) {
          nextContinuationToken = resultSet.getString(1);
          break;
        }
        resultIndex++;
        entries.add(resultSet.getString(1));
      }
      return new Page<>(entries, nextContinuationToken);
    } finally {
      closeQuietly(resultSet);
    }
  }
Execute listValidDatasetsSql statement.
@param statement the listValidDatasetsSql statement.
@param accountId the id for the parent account.
@param containerId the id of the container.
@param pageToken the page token.
@return the page of the dataset names.
@throws SQLException
ambry-account/src/main/java/com/github/ambry/account/mysql/DatasetDao.java