• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem performing change password application using jsp

 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


This is the Javascript and designing page
the jsp connection file with the database is:


Database consists of only id and oldpassword fields.
The problem here the update query in not firing and there is no change in the database.Please help
 
Saloon Keeper
Posts: 7582
176
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Several points, in no particular order:

Java code belongs in a backing bean or a servlet, not jn JSPs (which should only be used to generate the view).

The code is wide open to SQL injection attacks; start using PreparedStatement. You seem to have started doing that, but the parameter isn't added correctly, and it isn't actually being used.

The passwords seem to be stored in cleartext, which is another big no-no; they should be hashed using an algorithm such as SHA-2. That way they can not ever be accessed as cleartext.

As to debugging, I suggest to print out the full stack trace of exceptions, not just what line 43 does.
 
VarunS Singh
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks for the help
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

VarunS Singh wrote:This is the Javascript ...


That is not JavaScript. It's just Java code that is inappropriately (as Tim pointed out) placed in the JSP.

JavaScript is a completely different language.
 
Rancher
Posts: 4801
50
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think that was referring to the code block above it, and not the one below.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Dave Tolls wrote:I think that was referring to the code block above it, and not the one below.


Could be. Best to make sure.
reply
    Bookmark Topic Watch Topic
  • New Topic