0% found this document useful (0 votes)
16 views1 page

JSP Login Authentication Script

The document is a JSP page for a login system created by the author 'kanoo' on February 11, 2025. It connects to a Derby database to validate user credentials and includes logic for successful and failed login attempts. If the login is successful, it redirects to a welcome page; otherwise, it displays a login failure message and redirects back to the index page.

Uploaded by

Abdulaziz Kanoor
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views1 page

JSP Login Authentication Script

The document is a JSP page for a login system created by the author 'kanoo' on February 11, 2025. It connects to a Derby database to validate user credentials and includes logic for successful and failed login attempts. If the login is successful, it redirects to a welcome page; otherwise, it displays a login failure message and redirects back to the index page.

Uploaded by

Abdulaziz Kanoor
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

C:/Users/kanoo/OneDrive/Documents/NetBeansProjects/prac6c/web/login.

jsp
<%--
Document : login
Created on : 11 Feb, 2025, [Link] PM
Author : kanoo
--%>
<%@page contentType="text/html"%>
<%@page import="[Link].*" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<%
try
{
[Link]("[Link]");
Connection
con=[Link]("jdbc:derby://localhost:1527/2804","root","
root");
String uname=[Link]("uname");
String pwd=[Link]("pwd");
PreparedStatement pst=[Link]("Select password
from registration where username='"+uname+"'");
ResultSet rs=[Link]();
if([Link]())
{
if([Link](1).equals(pwd))
{
%>
<%@include file="[Link]" %>
<%
}
else
{
%>
<h1>LOGIN FAILED</h1>
<%@include file="[Link]" %>
<%
}
}
else
{

%>
<%="User doesn't Exists"%>
<%@include file="[Link]"%>
<%
}
}catch(Exception e)
{
[Link](e);
}

%>
</body>
</html>
1.1 of 1 2025.02.11 [Link]

You might also like