Solve my code

Solve my code

import javax.servlet.*;

import javax.servlet.http.*;

import java.sql.*;

import java.io.*;

public class ChangeDetails extends HttpServlet{

public void doPost(HttpServletRequest

request,HttpServletResponse response)throws ServletException, IOException{

response.setContentType("text/html");

response.setHeader("cache-control","no-cache");

PrintWriter out=response.getWriter();

String UserName=request.getParameter("uname");

String OldPassword=request.getParameter("opassword");

String NewPassword=request.getParameter("npassword");

Connection con=null;

String uid="";

String pass="";

try{

Class.forName("oracle.jdbc.driver.OracleDriver");

con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","bms","abc");

Statement stmt=con.createStatement();

ResultSet rs=stmt.executeQuery("select uname,password from userdetails");

while(rs.next()){

uid=rs.getString("uname");

pass=rs.getString("password"); }

if(pass.equals(OldPassword)){

Statement st1=con.createStatement();

st1.executeUpdate("update userdetails set

password='"+NewPassword+"' where uname='"+UserName+"'");

out.println("Password changed successfully");

con.close(); }

else{

out.println("Invalid Old Password");

}

}catch(Exception e){ }

}

}

what is the mistake in this code! This is working only one record doesn't work multiple records

View Answers









Related Tutorials/Questions & Answers:
Solve my code
Solve my code  import javax.servlet.*; import javax.servlet.http.*; import java.sql.*; import java.io.*; public class ChangeDetails extends... is the mistake in this code! This is working only one record doesn't work
Small Bug How to solve in my code
Small Bug How to solve in my code  String season=""; pst... +=rs.getString("season") + ","; } in above code seasons +=rs.getString("season") + ","; it shows bug in findbugs tool.. but it executes successfully how to solve
Advertisements
solve my question shortly
solve my question shortly  <html> <head> <script>.... I have corrected your errors now you can run your code easily. I have also made... called it on form event i.e. onsubmit event. The changed code is as follows : <
plz solve my query?
plz solve my query?  how to remove all the options from select control in html using java script?   JavaScript remove all items <html> <script language="javascript" > function removeAllItems(selectbox
Please Help To Solve My Problem
Please Help To Solve My Problem  PHP I Have 6 Textbox and 1 ok button. 6 Textbox to Add the 6 Team Name. Each Team Name In String(Like- A,B,C,D,E,F... With B Team when A Team Play With B Team Again Then Generate Error. I Am Solve
plz anyone can solve my
plz anyone can solve my  creat an applet prog which accepts the details of 10 customers like name , address , city , ect. and display it   import java.awt.*; import javax.swing.*; import java.awt.event.*; import
help me about to solve my qustion
help me about to solve my qustion   An employee receives 15 SR per hour for the first 8 hours of week. After 8 hours (overtime) his rate becomes 20 SR per hour . Write a java class that ask a user to enter the number of hours he
ajax code please help to solve this........
ajax code please help to solve this.  in this i am trying to get data from datbase and put it in combo box and then display it down using table... the fourth one similarly. For the above code, we have used 3 database tables
Pls review my code - Struts
Pls review my code  Hello friends, this is my code in struts action class this page contains checkboxes and radiobuttons also. when i enter the submit it shows me blank page. can anybody solve my problem its urgent. help me
Problem in my code - Development process
Problem in my code  Plz go thru this code. I want to check login and pwd with database. Backend MsAccess , Table name : Reg , Dsn Name: JJ While executing code am getting 404 error User Name Password
pls review my code - Struts
pls review my code  Hello friends, This is the code in struts. when i click on the submit button. It is showing the blank page. Pls respond soon its urgent. Thanks in advance. public class LOGINAction extends Action
this is my code java - Date Calendar
this is my code java  /* * NewJFrame.java * * Created on 11... NOT modify this code. The content of this method is * always regenerated...; jTextField1.setText(months); #### This My problem jTextField2.setText(days
pls review my code - Struts
pls review my code  When i click on the submit page i am getting a blank page Pls help me. thanks in advance. public ActionForward execute( ActionMapping mapping, ActionForm form, HttpServletRequest request
doubt in my program code - Java Beginners
doubt in my program code  i have developed a web browser... the name on that button.can u please help me out to solve this problem.if u need the code i developed i can send u to ur mail if u give ur mail id
Solve it
Solve it  How to calculate the value which contains oparator and operand both using command line argument
solve this
solve this   Create a student class. The student object should have studentid, studentname, subject and marks as properties. Also generate the getter and setter methods. Create 5 objects of this class and populate values
ModuleNotFoundError: No module named 'my-first-code-in-python'
ModuleNotFoundError: No module named 'my-first-code-in-python'  Hi...: No module named 'my-first-code-in-python' How to remove the ModuleNotFoundError: No module named 'my-first-code-in-python' error? Thanks   
ModuleNotFoundError: No module named 'my-first-code-in-python'
ModuleNotFoundError: No module named 'my-first-code-in-python'  Hi...: No module named 'my-first-code-in-python' How to remove the ModuleNotFoundError: No module named 'my-first-code-in-python' error? Thanks   
Form Code To Dispay Webpages On My Site
Form Code To Dispay Webpages On My Site  I want to use a form input box to display different pages on my site depending on the code the user types into the box. example: Producer Code 1234 would bring up Producer 1 page
Not sure whats wrong with my code HELP PLEASE?!?!
Not sure whats wrong with my code HELP PLEASE?!?!  I cant figure out what I am doing wrong in my code can anyone help me out??? Grades ADS_TO_REPLACE_1 function computeGrade( ) { var hw, lab, midt, fin, avg; hw
Solve
add the numbers and print the output  There will be 5 numbers (each in a new line) written in a text file. Text file name will be ?input2.txt?. Your Java code should read that text file, add all the numbers and print the output
My Servlet code not working - Development process
My Servlet code not working  HHi, After executing servlet am getting blank screen. Am using weblogic server and Eclipse editor. But jsp is working fine. Steps(what i did ) 1)Created servlet (In eclipse) and export it (saved
anyone willing to look over my code? (java)
anyone willing to look over my code? (java)  package inorder.without.cheats; import java.util.Arrays; import javax.swing.JOptionPane; public class InOrderWithOutCheats { public static void main(String[] args
i am unable to identify the error in my code
i am unable to identify the error in my code  class Program { public static void main(String[] args) { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); System.out.println("enter
i am unable to identify the error in my code
i am unable to identify the error in my code  class Program { public static void main(String[] args) { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); System.out.println("enter
how can i simplify my java code
how can i simplify my java code  /* Create a program that prompts... Scanner (System.in); String pass=""; int c = 1; int code=0...=Integer.toString(f); String q=Integer.toString(g); String r=Integer.toString
What's wrong with my pagination code in JSP?
What's wrong with my pagination code in JSP?  Dear experts, I've.... Hope someone can advise me how to. Thanks! print("code sample"); <...; print("code sample");   JSP Pagination The given code retrieves
ERROR with my JAVA code - Java Beginners
ERROR with my JAVA code  The error came up in my main method... it wasnt there until i finished my actionListener coding so I dont know how to fix this....it is really stressing me out!! HELP!!! import java.awt.*; import
Please help me to modify my java code from php code
Please help me to modify my java code from php code  i want to covert this php code int java/JSP . if (isset($_POST['orders'])) { $orders...]); $array[] = $item[1]; } } I tried like this (see below JSP code
Please help me to modify my java code from php code
Modify Java code from PHP Code  i want to covert this php code int...]; } } I tried like this (see below JSP code) ... but this is not giving me the exact result as the above PHP code is giving. So please help me to convert
fetch database value to text box based on selected value my code given below pls correct my code
fetch database value to text box based on selected value my code given below pls correct my code  my Code Given below Pls... help me send correct code for me jsp file... <%@page contentType="text/html" pageEncoding
fetch database value to text box based on selected value my code given below pls correct my code
fetch database value to text box based on selected value my code given below pls correct my code  my Code Given below Pls... help me send correct code for me jsp file... <%@page contentType="text/html" pageEncoding
if my database(oracle) connection failure means wat is the code to write in exception ?
if my database(oracle) connection failure means wat is the code to write in exception ?  if my database(oracle) connection failure means wat is the code to write in exception
this is my code but i cant able to run it wt is the problem
this is my code but i cant able to run it wt is the problem  import java.io.*; class createthread { int thread=4,i; class thread1 extends createthread { public void run() { for(i=0;i
this is my code but i cant able to run it wt is the problem
this is my code but i cant able to run it wt is the problem  import java.io.*; class createthread { int thread=4,i; class thread1 extends createthread { public void run() { for(i=0;i
My Base Class is Changing every time in my code. How I can overcome this?
My Base Class is Changing every time in my code. How I can overcome this?  I have had the below question asked in interview, i'm curious to learn... to change Generator). So, as an example of the code public class GeneratorBase1
Need someone to check and modify my simple code - Java Beginners
Need someone to check and modify my simple code   How to write a class that contains Variables that hold hourly rate of pay, number of hours...); } }   Hi Friend, You can use following code: import
this is my javascript code and i am not understanding the mistake in this,please help me?
this is my javascript code and i am not understanding the mistake in this,please help me?  <html> <h2>Form Validation</h2> <script language = "Javascript"> function checkEmail
solve this pbm
solve this pbm  its not working the code for databae access using servlets
How to solve this java code by adding the student marks not in the list of the table. For example -10 and 156 in GUI?
How to solve this java code by adding the student marks not in the list of the table. For example -10 and 156 in GUI?  import java.awt.*; import javax.swing.*; import java.awt.event.*; public class MarkStudent { double
ModuleNotFoundError: No module named 'solve'
ModuleNotFoundError: No module named 'solve'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'solve' How to remove the ModuleNotFoundError: No module named 'solve'
how to solve
how to solve   log4j:WARN No appenders could be found for logger (org.apache.struts.util.PropertyMessageResources). log4j:WARN Please initialize the log4j system properly
solve this pbm
solve this pbm  sir rows are also inserting i have checked in the database also the rows are not affected in the table . The first pbm wich i have sent to you is not yet solved.......... pls give me detail explaination how we
I need help on my Java code.... please please help me out!?
I need help on my Java code.... please please help me out!?  Well my code is supposed to ask for an input file and then (ex: input.txt), read... in the file. Also it should be displayed on the screen. However my code doesn't display
I want to Transfer only 1/3rd of contents from one folder to other but my code is transferring all contents
I want to Transfer only 1/3rd of contents from one folder to other but my code is transferring all contents  private static void copyFilesRecursively(File src, File dest) throws IOException { if (src.isDirectory
I'm getting an illgal start of expression error in my code for the public static boolean portion at the bottom... any ideas?
I'm getting an illgal start of expression error in my code for the public static boolean portion at the bottom... any ideas?  heres my code import...; }}}}}}   Here is a code of number game. We have modified
please check my code is wrong or ok.it was not work .this is form validation in javascript using jsf page
please check my code is wrong or ok.it was not work .this is form validation in javascript using jsf page  <p>?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN
solve this problem
solve this problem  I typed this program and compiled.The program is compiled but when i eneterd url in tomcat server. Its not giving error but only... Friend, Here is our code. Check it. import java.io.*; import java.sql.*; import
how to solve this..
how to solve this..  Given a list of students and their marks Name | Science | Math | English | Computer Ahmad | 28 | 100 | 66 | 34 Samad | 56 | 89 | 55
how to solve this..
how to solve this..  Given a list of students and their marks Name | Science | Math | English | Computer Ahmad | 28 | 100 | 66 | 34 Samad | 56 | 89 | 55

Ads