Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa JSP-Interview-Questions change password servlets

Have Programming Question? Ask it here!
 
 
 


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



Advertisement
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 Tutorials/Questions & Answers:
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
Advertisements
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
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>
Change Password Code in JSP
Change Password Code in JSP In this example we will see how to change password...(""); ChangePasswordForm.jsp <html> <head> <title>Change password in jsp<...;strong>Change password in JSP form</strong></h2> <body> <
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
Password
Password  make a program which ask ask the username and password * in this format. in C language
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
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
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
. Anyways, please visit the following links: http://www.roseindia.net/servlets/introductiontoconfigrationservlet.shtml http://www.roseindia.net/servlets
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
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
Servlets and
Servlets and   Sir...! I want to insert or delete records form oracle based on the value of confirm box can you please give me the idea.... thanks
servlets
which are the differ ways you can communicat between servlets  which are the differ ways you can communicat between servlets   Different ways of communicating between servlets:- 1)Using RequestDispatcher object. 2
servlets
package supports the development of servlets that use the HTTP protocol. The classes... javax.servlet.GenericServlet and serves as the base class for HTTP servlets. HttpServlet-Request
servlets
what are sessions in servlets  what are sessions in servlets   A Session refers to all the request that a single client makes to a server...: http://roseindia.net/jsp/jspsession/ http://www.roseindia.net/servlets
the servlets
what is diff between generic servlets and httpservlets  what is diff between generic servlets and httpservlets   Difference between GenericServlet and HTTPServlet: 1)GenericServlet belongs to javax.servlet package
servlets
regarding the user usage and habits. Servlets sends cookies to the browser client...://www.roseindia.net/jsp/jspcookies.shtml http://www.roseindia.net/servlets/use
servlets
servlets  hi i am using servlets i have a problem in doing an application. in my application i have html form, in which i have to insert on date value, this date value is retrieved as a request parameter in my servlet
servlets
what are filters in java servlets  what are filters in java   Filters are powerful tools in servlet environment. Filters add certain functionality to the servlets apart from processing request and response paradigm
the servlets
not to duplicate the names of application scope objects or change the values when they're
servlets
and if the menu has to change, only one file needs editing. For more information
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
"); 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..."); String Email=req.getParameter("Email"); String Password=req.getParameter("Password"); String ConformPassword=req.getParameter("ConformPassword
Servlets
"); String Password=req.getParameter("Password"); String ConformPassword...("Email"); String Password=req.getParameter("Password"); String
Servlets
Password=req.getParameter("Password"); String ConformPassword
SERVLETS
"); String Password=req.getParameter("Password"); String
SERVLETS
change the other packages. or simply import the following packages: import
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> <
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
forgot password?
forgot password?  forgot password
password check
password check  how to check sighup passowrd and login password
Advertisements
 

 

 

DMCA.com