Help with a web service in java that is getting data or records from database

Help with a web service in java that is getting data or records from database. This web service should receive parameters from a web form then display the records in xml. Please give me an example or Urls where I can get this?
Thanks in advance.