aspose file tools*
The moose likes JDBC and the fly likes executeUpdate() not working Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "executeUpdate() not working" Watch "executeUpdate() not working" New topic
Author

executeUpdate() not working

Rakesh Keerthi
Ranch Hand

Joined: Jul 16, 2012
Posts: 136
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

Joined: Jul 09, 2011
Posts: 272

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.


Ashwin Sridhar
SCJP | SCWCD | OCA
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60992
    
  65

Read this JspFaq entry.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Wei Dai
Ranch Hand

Joined: Jun 22, 2005
Posts: 86
> ps.executeUpdate();

int updatedCount=ps.executeUpdate();
System.out.println(updatedCount); //should print 0, then you should check your where clause.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: executeUpdate() not working