You are trying to compare one file with all the assignment files whose locations are stored in database. First thing to me is that there will be memory leak due to not closed buffered reader. ...