• 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

unable Update table using Prepared Statement

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok, you posted your code, but what is exactly the problem? What happens when you run this code? Do you get an error? Please explain and copy & paste the error message here.

The SQL statement updates the column 'password' in the 'registration' table for a record which has a specific value in the 'email' column. That's not what I would expect a method called "forget" to do. Is "forgetting" the same thing as changing a password?
 
jiral dekhtawala
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@Jesper de Jong
i tried to update password on my database with compare email id exist in DB. But surprise is that i didn't get any error or exception during handle or execute this code... look below attach
Capture.JPG
[Thumbnail for Capture.JPG]
 
jiral dekhtawala
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
try with Simple Statement Still same issue

 
Rancher
Posts: 4801
50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What happens when you run that second query against your database directly, through whatever tool comes with your db?
By directly, I mean copy and paste it from your sys out, not write what you think it looks like.
 
Jesper de Jong
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

jiral dekhtawala wrote:@Jesper de Jong
i tried to update password on my database with compare email id exist in DB. But surprise is that i didn't get any error or exception during handle or execute this code... look below attach


The result "update value 1" means that one row is updated.

That is exactly what I would expect.

What exactly are you surprised about? What did you expect the program to do, and how does that differ from what it is actually doing?
 
jiral dekhtawala
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ya that's right but on actual DB value does not updated...
 
Jesper de Jong
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you using transactions? Did you remember to commit the transaction?
 
jiral dekhtawala
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@Dave Tolls
i had also try with manually using DB tool its work success..
 
jiral dekhtawala
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@Jesper de Jong
no transaction simple update password on DB with acquire Email id
 
Dave Tolls
Rancher
Posts: 4801
50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

jiral dekhtawala wrote:@Dave Tolls
i had also try with manually using DB tool its work success..



OK.
So, going with Jesper's line, are you committing?
What database are you using?
Is your connection auto commit?
 
jiral dekhtawala
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
mysql
not at all
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic