I am working on JSP-servlet to create a page which contains couple of editable drop-down list, text fields etc. I am using mysql at back end. I want to access the database in a such a way that I would be able to compare the database with what user has entered. If it matches, whatever user has entered will go in a flat file say txt file and if it is not present in database, error message will be displayed. At the moment I was able to create the UI part. But I am stuck at Submit button. I mean what condition should I write at click event to compare with database. Result sets is what i can see. Any suggestion guys? Any tutorials available about this? Thank you very much.