This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
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

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
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: 2565

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.
I agree. Here's the link:
subject: executeUpdate() returned is -1
It's not a secret anymore!