File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes executeUpdate() returned is -1 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "executeUpdate() returned is -1" Watch "executeUpdate() returned is -1" New topic

executeUpdate() returned is -1

Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2234

Hi ,

Please tell me executeUpdate() returned is -1 , what does this indicate ?

Save India From Corruption - Anna Hazare.
Jan Cumps

Joined: Dec 20, 2006
Posts: 2541

Ooch, the specs (java.sql.Statement) say:
either (1) the row count for SQL Data Manipulation Language (DML) statements or (2) 0 for SQL statements that return nothing

-1 is an undocumented return value? Please show your update statement.

OCUP UML fundamental and ITIL foundation
Balu Sadhasivam
Ranch Hand

Joined: Jan 01, 2009
Posts: 874

OR Do you mean getUpdateCount() ? which returns -1 when there no results.
It is sorta covered in the JavaRanch Style Guide.
subject: executeUpdate() returned is -1
jQuery in Action, 3rd edition