Home Answers Viewqa JSP-Interview-Questions change password servlets

 
 


lizhengchen
change password servlets
2 Answer(s)      4 years and 4 months ago
Posted in : JSP-Interview Questions

View Answers

January 20, 2009 at 11:12 PM


Hi,
I dont have the time to write the code. But i can give you the idea, to write the code.
In view part you have to create a link for change the password page in that page there should be a three text box, one for old password and another for new password and the last one for the confirm password.
You also have validation for these text boxes (ex. should not be blank, newpassword and confirm password should be same).
In database there should be a field for password for curresponding user.
The new password and the confirm password should be same. After submiting the page you have to update the database( Update the value for the password).

Try this hope it will help you.

January 22, 2009 at 1:02 AM


Hi friend,

i am sending a code to change password by servlet

import java.io.*;
import java.sql.*;
import javax.sql.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;

public class UpdateServlet extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.setContentType("text/html");
PrintWriter out = response.getWriter();
String driver = "com.mysql.jdbc.Driver";
String url = "jdbc:mysql://localhost:3306/test";;
String username = "root";
String password = "root";
String query = "UPDATE users SET users.password = \"bunty\" WHERE users.username = \"Sandeep\";";
showTable(driver, url, username, password, query, out);
}
public void showTable(String driver, String url, String username, String password, String query, PrintWriter out) {
try {
Class.forName(driver);
Connection connection = DriverManager.getConnection(url, username, password);
Statement statement = connection.createStatement();
statement.executeQuery(query);
query = "SELECT * FROM users;";
ResultSet resultSet = statement.executeQuery(query);
while(resultSet.next()) {
out.print("User Name= " + resultSet.getString("username"));
out.print("Password= " + resultSet.getString("password"));
out.print("Email ID= " + resultSet.getString("email"));
}
connection.close();
}catch(ClassNotFoundException cnfe) {
System.err.println("Error loading driver: " + cnfe);
}catch(SQLException sqle) {
System.err.println("Error connecting: " + sqle);
} catch(Exception ex) {
System.err.println("Error with input: " + ex);
}
}
}


Thanks........










Related Pages:
change password servlets - JSP-Interview Questions
change password servlets  hi all, i need the codes to create a change... a link for change the password page in that page there should be a three text box... you.  Hi friend, i am sending a code to change password by servlet
change password
change password  how to change password in the login form.... by giving options to user like this old password, new password.. pls help
password change
password change  Hi , I am using jsf and trying to write a code to change the password of a user . Ihave to retrine userid fromdata base how to do that using session
Change Password - JSP-Servlet
Change Password  Hi all, Please kindly help me with jsp code and explanations to enable me write a change password program. This program will connect to mssql database 2000. Thanks
change password - JSP-Servlet
change password  hi, my problem is as follows: i am creating... for a user. this web page consists of changing the password for the existing user. it look like this: current password new password confirm new password SUBMIT
How to change password mask field?
How to change password mask field?  I want to use '*' character in password. thanks in advanced............   password masking character in the standard password field can't be changed
Password History - JSP-Servlet
Password History  I am using servlets and in my application i want to maintain password history.It means on password change My application should check previous 5 password so that new password can't be same to 5 old password
servlets
in servlets   There are four ways of authentication:- HTTP basic... authentication In HTTP basic authentication the server uses the username and password send by theclient. The password is sent using simple base64 encoding but it?s
servlets
and if the menu has to change, only one file needs editing. For more information
the servlets
not to duplicate the names of application scope objects or change the values when they're
Servlets
"); String Email=req.getParameter("Email"); String Password=req.getParameter("Password"); String ConformPassword=req.getParameter..."); out.println(rs.getString(4) +"Password
Servlets
("Email"); String Password=req.getParameter("Password"); String..."); out.println(rs.getString(4) +"Password
Servlets
"); String Password=req.getParameter("Password"); String ConformPassword...("Email"); String Password=req.getParameter("Password"); String
Servlets
"); String password=req.getParameter("Password"); String..."); String Email=req.getParameter("Email"); String Password=req.getParameter("Password"); String ConformPassword=req.getParameter("ConformPassword
SERVLETS
"); String Password=req.getParameter("Password"); String
Servlets
Password=req.getParameter("Password"); String ConformPassword
SERVLETS
change the other packages. or simply import the following packages: import
how to change password into one jsp to another jsp
how to change password into one jsp to another jsp  i have two jsps in one jsp i give one password and confirm password, in another jsp i want change...; Here is a jsp code that change the password. 1)change.jsp: <html>
Password validation
a change password form. In that i have to check the values given in the new... the user and change the password. 1)change.jsp <html> <script>...;td><input type="submit" value="Change Password"></td></tr>
Password validation
Password validation  Hi. I have a change password form. In that i..., New password and conform password from the user and change the password. 1...="Change Password"></td></tr> </table> </form> <
Password validation
Password validation  Hi. I have a change password form. In that i..., New password and conform password from the user and change the password. 1...="Change Password"></td></tr> </table> </form> <
Password validation
Password validation  Hi. I have a change password form. In that i..., New password and conform password from the user and change the password. 1...="Change Password"></td></tr> </table> </form> <
Password validation
Password validation  Hi. I have a change password form. In that i..., New password and conform password from the user and change the password. 1...="Change Password"></td></tr> </table> </form> <
Change root password of MYSQL using Java
Change root password of MYSQL using Java In this tutorial, you will learn how to change the root password of MYSQL database using java code. For every... to change the root password with the known password. For this, we have created
Looking for change password in iphone application sdk using sqlite
Looking for change password in iphone application sdk using sqlite  i am trying to change old password in my iphone application my code is below...) == SQLITE_OK) { NSString *querySQL = [NSString stringWithFormat: @"SELECT password
array password - Java Beginners
array password  i had create a GUI of encryption program that used the array password. my question is can we do the password change program? i mean we change the older password with the new password
Changing root Password
Changing root Password  how do i change the root password in mysql
jsp and servlets
jsp and servlets  i want code for remember password and forget password so please send as early as possible ............. thanks in advance  ... is a part forgot password in this application which will be helpful for you. Try
forgot password - Struts
forgot password  i want to proper code for forgot password, means how to send password into email id if i forgot my password   import..., Please explain which technologies you want to use. java jsp servlets
Password
Password  make a program which ask ask the username and password * in this format. in C language
Servlets - JDBC
;root"; String password = "root"; try{ Class.forName(driver).newInstance(); conn = DriverManager.getConnection(url+dbName,userName,password
Servlets errors in same page.
Servlets errors in same page.  How do I display errors list in the same page where a form field exists using servlets...........i.e. without using JSP? Please explain with a simple username password program
code for connecting reset password code to database.
code for connecting reset password code to database.  code for connecting reset password code to database.   Hello Friend, Do you want to change your password and update the password to database
MySQL Creating account and changing password
or  you want to change the password then make new user .This lesson you learn how...; password to same random to be string . the better way is to change the login... MySQL Creating account and changing password   
servlets - Servlet Interview Questions
==""){ //please enter passward alert("Please enter Password...: Password...; } if(theForm.password.value==""){ //please enter passward alert("Please enter Password
servlets - JSP-Servlet
servlets.  Hi friend, employee form in servlets...;This is servlets code. package javacode; import java.io.*; import java.sql.... password = "amar123"; Connection con = null; try{ Class.forName
servlets
servlets  why we are using servlets
servlets
servlets  what is the duties of response object in servlets
servlets
what are advantages of servlets  what are advantages of servlets   Please visit the following link: Advantages Of Servlets
servlets - JSP-Servlet
userName = "amar"; String password = "amar123"; Connection con = null; try{ Class.forName(driver); con = DriverManager.getConnection(url+db,userName,password... servlets link , read more and more information about servlet. how to compile
Using MYSQL Database with JSP & Servlets.
Using MYSQL Database with JSP & Servlets.  ... is:    mysql -h hostname -u username -p[password]  Or    mysql -h hostname -u username --password
Servlets
Servlets  How to edit and delete a row from the existing table in servlets
servlets
servlets  How do you communicate between the servlets?   We can communicate between servlets by using RequestDespatcher interface and servlet chaining
servlets
what is the architecture of a servlets package  what is the architecture of a servlets package   The javax.servlet package provides interfaces and classes for writing servlets. The Servlet Interface The central
Servlets
Servlets  How to check,whether the user is logged in or not in servlets to disply the home page
servlets
servlets  why we require wrappers in servlets? what are its uses? Please explain   These wrappers classes help you to modify request...://www.roseindia.net/servlets/response-filte.shtml
Servlets
. Anyways, please visit the following links: http://www.roseindia.net/servlets/introductiontoconfigrationservlet.shtml http://www.roseindia.net/servlets
servlets
servlets  How to open and read the contents of a text file in servlets?   Please visit the following link: Read text file using Servlet
servlets
servlets   Hi what is pre initialized servlets, how can we achives?   When servlet container is loaded, all the servlets defined in the web.xml file does not initialized by default. But the container receives
servlets
servlets why do we need web-inf directory in web application  why do we need web-inf directory in web application? means what's the benefits of doing so

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.