0% found this document useful (0 votes)
8 views2 pages

Java Login

The document contains Java code to update a user's password in a database. It first selects the user from the login table matching the username and password. If found, it checks if the new passwords match. If they match, it updates the user's password in the login table. If any issue occurs, an error message is displayed.

Uploaded by

Ak Gupta
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views2 pages

Java Login

The document contains Java code to update a user's password in a database. It first selects the user from the login table matching the username and password. If found, it checks if the new passwords match. If they match, it updates the user's password in the login table. If any issue occurs, an error message is displayed.

Uploaded by

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

String sql="select * from login where uid='"+[Link]()+"' and upass=?

";

try{

pst=[Link](sql);

[Link](1,[Link]());

rs=[Link]();

if ([Link]()){

[Link]();

[Link]();

if([Link]().equals([Link]()))

String sql1="update login set upass=? where uid='"+ [Link]() +"'";

try

pst=[Link](sql1);

[Link](1,[Link]());

[Link]();

[Link](null,"YOUR PASSWORD HAS CHANGED");

catch(Exception e)

[Link](null,e);

else{

[Link](null,"Incorrect Username or password");


}

catch(Exception e)

[Link](null,e);

You might also like