I think should be pretty straightforward.
You should be able to query the field values from your servlet and write
them to a file.
A more elegant way, however is to use JSP and bean.
This
thread should be posted in SERVLET, JSP or
JSF section as it does not
deal with with database per say.
[ September 14, 2007: Message edited by: Bougnon Kipre ]