<%-- Document : Login Created on : 4 Sep, 2024, 11:33:32 AM Author : shaad --%> <%@page contentType="text/html" import="java.sql.*"%> JSP Page

Login JSP Page

<% String uname=request.getParameter("t1"); String pass=request.getParameter("pass"); try { Connection con=DriverManager.getConnection(""); PreparedStatement stmt=con.prepareStatement("Select pass from userdetails where uname=?"); stmt.setString(1, uname); ResultSet rs = stmt.executeQuery(); if (rs.next()) { if(pass.equals(rs.getString(1))) { out.println("

Login Successful

"); } else { out.println("

User name does not exist

"); %> <% } } } catch(Exception e) { out.println(e); } %>