This may help you,
1. You are fetching details from DATABASE.
2. from jsp you passthis code to browser:
<%@ page language="java" import="java.sql.*,java.io.*,java.util.*" %>
<%
String type=request.getParameter("somedummy");
try{
--- stuff wil come here - retrieving and storing in result set
out.println(""+resultSet.getString("id")+\
"");
} catch(Exception e)
{
out.println("<h1>"+"Server Error"+ e+ "<h1>");
}
%>
3. Revert Back if u need my help