%--
Document : Login
Created on : 4 Sep, 2024, 11:33:32 AM
Author : nmcc.student
--%>
<%@page contentType="text/html" import="java.sql.*"%>
JSP Page
Login JSP Page
<%
String uname=request.getParameter("t1");
String pass=request.getParameter("pass");
try{
//class.forNAme("");
Connection con=DriverManager.getConnection("");
PreparedStatement stmt=con.prepareStatement("Select password from userdetails where username=?");
stmt.setString(1,uname);
ResultSet rs=stmt.executeQuery();
if (rs.next()){
if(pass.equals(rs.getString(1)))
{
out.println("User name does not exist
");
%>
<%
}
}
}catch(Exception e){out.println(e);}
%>
}
index.html
Login Page
Login Page