<%@ page import="java.sql.*" %>
<html>
    <body>
        <%
            String s = (String) request.getParameter("T1");
            String s1 = (String) request.getParameter("T2");
            try {
                Class.forName("com.mysql.jdbc.Driver").newInstance();
                Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/sdms", "root", "root");
                Statement st = con.createStatement();

                String query = "select * from sdms.signup where empid = '" + s + "' and  Password = '" + s1 + "'";
                ResultSet rs = st.executeQuery(query);
                if (rs.next()) {
                   
                    String fname=rs.getString("first_name");
                     request.setAttribute("name", fname);
                    response.sendRedirect("welcome.jsp");
                }


            } catch (Exception e) {
                e.printStackTrace();

            }
        %>
    </body>
</html>