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 codeSolve 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 codeSmall 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 shortlysolve 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 ProblemPlease 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 myplz 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 - StrutsPls 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 processProblem 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 - Strutspls 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 Calendarthis 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 - Strutspls 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 Beginnersdoubt 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 itSolve it How to calculate the value which contains oparator and operand both using command line argument
solve thissolve 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
Form Code To Dispay Webpages On My SiteForm
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
Solveadd 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 processMy 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 codei 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 codei 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 codehow 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 BeginnersERROR 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 codePlease 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 codeModify 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
solve this pbmsolve this pbm its not working the
code for databae access using servlets
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 pbmsolve 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
solve this problemsolve 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