code: public byte[] getTile( int tx, int tyOsm, int zoom ) throws Exception {
          int ty = tyOsm;
          if (tileRowType.equals("tms")) {
              int[] tmsTileXY = MercatorUtils.osmTile2TmsTile(tx, tyOsm, zoom);
              ty = tmsTileXY[1];
          }
          int _ty = ty;
          return database.execOnConnection(connection -> {
              try (IHMPreparedStatement statement = connection.prepareStatement(SELECTQUERY)) {
                  statement.setInt(1, zoom);
                  statement.setInt(2, tx);
                  statement.setInt(3, _ty);
                  IHMResultSet resultSet = statement.executeQuery();
                  if (resultSet.next()) {
                      byte[] imageBytes = resultSet.getBytes(1);
                      return imageBytes;
                  }
              }
              return null;
          });
      }
docs: Get a Tile's image bytes from the database.
  
  @param tx the x tile index.
  @param tyOsm the y tile index, the osm way.
  @param zoom the zoom level.
  @return the tile image bytes.
  @throws Exception