Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Row count for an update statement

 
kartik krishnan
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It returns only the actually affected rows, thus when the previous value wasn't the same.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic