import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.sql.*;
public class Entry extends HttpServlet
{
Connection cn;
String s1,s2,s3;
public void service(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
{
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>");
s1 = req.getParameter("t1");
s2 = req.getParameter("t2");
s3 = req.getParameter("t3");
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
cn = DriverManager.getConnection("jdbc:odbc:emaildb", "admin", "");
Statement st=cn.createStatement();
out.println("Record Inserted...."+s1);
out.println("Record Inserted...."+s2);
out.println("Record Inserted...."+s3);
ResultSet rs=st.executeQuery("insert into emaillists values("+s1+","+s2+","+s3+")");
out.println("Record Inserted....");
rs.close();
st.close();
cn.close();
}
catch(Exception e)
{
out.println(e.getMessage());
}
out.println("<P> </P></FONT></BODY></HTML>");
}
}
import javax.servlet.*;
import javax.servlet.http.*;
import java.sql.*;
public class Entry extends HttpServlet
{
Connection cn;
String s1,s2,s3;
public void service(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
{
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>");
s1 = req.getParameter("t1");
s2 = req.getParameter("t2");
s3 = req.getParameter("t3");
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
cn = DriverManager.getConnection("jdbc:odbc:emaildb", "admin", "");
Statement st=cn.createStatement();
out.println("Record Inserted...."+s1);
out.println("Record Inserted...."+s2);
out.println("Record Inserted...."+s3);
ResultSet rs=st.executeQuery("insert into emaillists values("+s1+","+s2+","+s3+")");
out.println("Record Inserted....");
rs.close();
st.close();
cn.close();
}
catch(Exception e)
{
out.println(e.getMessage());
}
out.println("<P> </P></FONT></BODY></HTML>");
}
}