import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.sql.*;
public class emaildb extends HttpServlet
{
Connection cn;
/*private ServletConfig config;
public void init(ServletConfig config) throws ServletException
{
this.config=config;
}*/
public void service (HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
{
//HttpSession session = req.getSession(true);
res.setContentType("text/html");
PrintWriter out = res.getWriter();
out.println("<HTML><HEAD><TITLE>Emai List.</TITLE>");
out.println("</HEAD>");
out.println("<BODY bgColor=blanchedalmond text=#008000 topMargin=0>");
out.println("<P align=center><FONT face=Helvetica><FONT color=fuchsia style=\"BACKGROUND-COLOR: white\"><BIG><BIG>List of E-mail addresses.</BIG></BIG></FONT></P>");
out.println("<P align=center>");
out.println("<TABLE align=center border=1 cellPadding=1 cellSpacing=1 width=\"75%\">");
out.println("<TR>");
out.println("<TD>Name</TD>");
out.println("<TD>E-mail</TD>");
out.println("<TD>Website</TD></TR>");
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
cn = DriverManager.getConnection("jdbc:odbc:emaildb", "admin", "");
Statement st=cn.createStatement();
ResultSet rs=st.executeQuery("select * from emaillists");
while(rs.next())
{
out.println();
out.println("<TR>");
out.println("<TD>" + rs.getString(1) + "</TD>");
out.println("<TD>" + rs.getString(2) + "</TD>");
String s=rs.getString(3);
out.println("<TD><a href=" + s + ">" + s + "</a></TD>");
out.println("</TR>");
}
rs.close();
st.close();
cn.close();
}
catch(Exception e)
{
out.println(e.getMessage());
}
out.println("</TABLE></P>");
out.println("<P> </P></FONT></BODY></HTML>");
}
/*public void destroy()
{
}*/
}
import javax.servlet.*;
import javax.servlet.http.*;
import java.sql.*;
public class emaildb extends HttpServlet
{
Connection cn;
/*private ServletConfig config;
public void init(ServletConfig config) throws ServletException
{
this.config=config;
}*/
public void service (HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
{
//HttpSession session = req.getSession(true);
res.setContentType("text/html");
PrintWriter out = res.getWriter();
out.println("<HTML><HEAD><TITLE>Emai List.</TITLE>");
out.println("</HEAD>");
out.println("<BODY bgColor=blanchedalmond text=#008000 topMargin=0>");
out.println("<P align=center><FONT face=Helvetica><FONT color=fuchsia style=\"BACKGROUND-COLOR: white\"><BIG><BIG>List of E-mail addresses.</BIG></BIG></FONT></P>");
out.println("<P align=center>");
out.println("<TABLE align=center border=1 cellPadding=1 cellSpacing=1 width=\"75%\">");
out.println("<TR>");
out.println("<TD>Name</TD>");
out.println("<TD>E-mail</TD>");
out.println("<TD>Website</TD></TR>");
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
cn = DriverManager.getConnection("jdbc:odbc:emaildb", "admin", "");
Statement st=cn.createStatement();
ResultSet rs=st.executeQuery("select * from emaillists");
while(rs.next())
{
out.println();
out.println("<TR>");
out.println("<TD>" + rs.getString(1) + "</TD>");
out.println("<TD>" + rs.getString(2) + "</TD>");
String s=rs.getString(3);
out.println("<TD><a href=" + s + ">" + s + "</a></TD>");
out.println("</TR>");
}
rs.close();
st.close();
cn.close();
}
catch(Exception e)
{
out.println(e.getMessage());
}
out.println("</TABLE></P>");
out.println("<P> </P></FONT></BODY></HTML>");
}
/*public void destroy()
{
}*/
}