/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.

 
 Contains all queries for delete, add and update of users
 
 */


import java.io.IOException;
import java.io.PrintWriter;
import java.sql.*;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


/**
 *
 * @author Varun
 */
public class Signup extends HttpServlet {
   
    
  
    protected void doPost(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
        
        PrintWriter out = response.getWriter();
        String s1 = request.getParameter("T1");
     String s2 = request.getParameter("T2");String s3 = request.getParameter("T3");String s4 = request.getParameter("T4");
     String s5 = request.getParameter("T5");
        try {

            Connection con = DataBase.getConnection();
            Statement st = con.createStatement();
            String q = "insert into sdms.signup values ('"+s1+"','"+s2+"','"+s3+"','"+s4+"','"+s5+"', 0 )";     
            
          st.executeUpdate(q);
         response.sendRedirect("admin.jsp");

           // out.print(s1);
        } catch (SQLException ex) {
            Logger.getLogger(Signup.class.getName()).log(Level.SEVERE, null, ex);
        }
     
     
     
        
        
    }


}
