wood burning stoves 2.0*
The moose likes JDBC and the fly likes Row count for an update statement Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Row count for an update statement" Watch "Row count for an update statement" New topic
Author

Row count for an update statement

kartik krishnan
Ranch Hand

Joined: Nov 19, 2006
Posts: 63
Consider a hypothetical situation where I have a table t_number with only two columns name varchar(30) and number int(10),

In my JDBC code, I am executing a sql query




From the api, we know that the rowCount will return the number of rows updated. Does the row count include the rows where the number column's previous value was 2? I am waiting for my laptop to arrive from Dell so I have not been able to test this yet. But I want to know this urgently.
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
It returns only the actually affected rows, thus when the previous value wasn't the same.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Row count for an update statement
 
Similar Threads
total number of rows in ResultSet
adding and deleting a row in html
How to find the number of rows in the resultset
COUNT+PSTMT error?
SQL duplicate data into a new PK