• Post Reply Bookmark Topic Watch Topic
  • New Topic

Prepared Statement with Where clause is not working  RSS feed

 
Kishor Joshi
Ranch Hand
Posts: 674
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi There
I have a table in which I am inserting value on a table using following command this is my method.



But this query showing error

Where I am wrong?


Thanks
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 36656
475
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kishor,
What is the exact error message?

Also, note that the convention is to use camelcase for variable names in Java. This means they begin with a lowercase and subsequent words use uppercase. Sp Contact_Name1 would be contactName1. I recommend starting to practice using this convention so you develop good habits.
 
Kishor Joshi
Ranch Hand
Posts: 674
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah after reading about prepared statement and update query now it is sorted out and solved
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 36656
475
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Great. What was the problem/solution?
 
Ron McLeod
Saloon Keeper
Posts: 1456
209
Android Angular Framework Eclipse IDE Java Linux MySQL Database Redhat TypeScript
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jeanne Boyarsky wrote:Great. What was the problem/solution?

Probably removing the WHERE Phone_no=? clause;
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 36656
475
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ron McLeod wrote:
Jeanne Boyarsky wrote:Great. What was the problem/solution?

Probably removing the WHERE Phone_no=? clause;

Oh. Of course. Because inserting a new row doesn't apply to other rows. In hindsight, that was obvious.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!