private int getContainerId(String resourceId) throws SQLException {
            int containerId = -1;
            String sql = "SELECT " + Cols.CONTAINER_ID.name() + " from " + ExtractProfiler.CONTAINER_TABLE.getName() + " where " + Cols.FILE_PATH + " ='" + resourceId + "'";
            int resultCount;
            try (ResultSet rs = statement.executeQuery(sql)) {
                resultCount = 0;
                while (rs.next()) {
                    containerId = rs.getInt(1);
                    resultCount++;
                }
            }

            if (resultCount == 0) {
                LOG.warn("Should have found a container for: {}", resourceId);
            } else if (resultCount > 1) {
                LOG.error("Records ids should be unique: {}", resourceId);
            }
/*
            if (containerId < 0) {
                System.err.println("CONTAINER ID < 0!!!");
                sql = "SELECT MAX("+ Cols.CONTAINER_ID.name() +
                        ") from "+ExtractProfiler.CONTAINER_TABLE.getName();
                rs = statement.executeQuery(sql);
                while (rs.next()) {
                    containerId = rs.getInt(1);
                }
                rs.close();
                if (containerId < 0) {
                    //log and abort
                    //return -1?
                } else {
                    containerId++;
                }

            }*/
            return containerId;
        }
This is a very task specific class that reads a log file and updates
the "comparisons" table.  It should not be run in a multithreaded environment.
tika-eval/tika-eval-app/src/main/java/org/apache/tika/eval/app/XMLErrorLogUpdater.java