class H2ScoreDistributionReader implements ScoreDistributionReader {

  @Override
  public ObjectScoreDistribution readForTermCountAndObject(int termCount, TermId objectId) throws PhenolException {
        try (final PreparedStatement stmt =
        conn.prepareStatement(
            String.format(H2_SELECT_BY_TERM_COUNT_AND_OBJECT_STATEMENT, tableName))) {
          stmt.setInt(1, termCount);
          try {
            stmt.setString(2, ObjHexStringConverter.object2hex(objectId));
          } catch (IOException e) {
            throw new RuntimeException("Unable to convert object id to hexadecimal String: " + objectId.toString());
          }
          try (final ResultSet rs = stmt.executeQuery()) {
        while (rs.next()) {
          return objectScoreDistributionFromResultSet(rs);
        }
      }
    } catch (SQLException e) {
      throw new PhenolException(
          "Problem with getting object score distribution for termCount: "
              + termCount
              + ", objectId: "
              + objectId);
    }

    throw new PhenolException(
        "Found no object for termCount: " + termCount + ", objectId: " + objectId);
  }

  public  H2ScoreDistributionReader(String pathDb, String tableName);

}