private void update(String errorTableName, String filePath, AbstractProfiler.PARSE_ERROR_TYPE type) throws SQLException {
            int containerId = getContainerId(filePath);
            String sql = "SELECT count(1) from " + errorTableName + " where " + Cols.CONTAINER_ID + " = " + containerId + " or " + Cols.FILE_PATH + "='" + filePath + "'";
            int hitCount;
            try (ResultSet rs = statement.executeQuery(sql)) {
                //now try to figure out if that file already exists
                //in parse errors
                hitCount = 0;
                while (rs.next()) {
                    hitCount = rs.getInt(1);
                }
            }

            //if it does, update all records matching that path or container id
            if (hitCount > 0) {
                sql = "UPDATE " + errorTableName + " SET " + Cols.PARSE_ERROR_ID + " = " + type.ordinal() + "," + Cols.FILE_PATH + "='" + filePath + "'" + " where " +
                        Cols.CONTAINER_ID + "=" + containerId + " or " + Cols.FILE_PATH + "='" + filePath + "'";

            } else {
                //if not and container id > -1
                //insert full record
                if (containerId > -1) {
                    sql = "INSERT INTO " + errorTableName + " (" + Cols.CONTAINER_ID + "," + Cols.FILE_PATH + "," + Cols.PARSE_ERROR_ID + ")" + " values (" + containerId + ", '" +
                            filePath + "'," + type.ordinal() + ");";
                } else {
                    //if container id == -1, insert only file path and parse error type id
                    sql = "INSERT INTO " + errorTableName + " (" + Cols.FILE_PATH.name() + "," + Cols.PARSE_ERROR_ID + ")" + "values ('" + filePath + "'," + type.ordinal() + ");";
                }

            }
            int updated = statement.executeUpdate(sql);
            if (updated == 0) {
                //TODO: log
                LOG.warn("made no updates in xmlerrorlogupdater!");
            } else if (updated > 1) {
                LOG.warn("made too many updates");
            }
        }
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