• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

executeUpdate() not working

 
Rakesh Keerthi
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Below is the code that i used to do executeUpdate(), it is not showing any exceptions and also it is not updating the table. to check if there are any null values i've printed the individual outputs but they are fine.



Thanks
 
Ashwin Sridhar
Ranch Hand
Posts: 277
Flex Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Having scriptlets inside a JSP is a bad approach in first place. You could have this code snippet in servlet.
Capture the return value of ps.executeUpdate() and check. It tells the number of rows affected by the query.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65120
91
IntelliJ IDE Java jQuery Mac Mac OS X
 
Wei Dai
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
> ps.executeUpdate();

int updatedCount=ps.executeUpdate();
System.out.println(updatedCount); //should print 0, then you should check your where clause.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic