org.springframework.jdbc

Class JdbcUpdateAffectedIncorrectNumberOfRowsException

  • All Implemented Interfaces:
    java.io.Serializable


    public class JdbcUpdateAffectedIncorrectNumberOfRowsException
    extends IncorrectUpdateSemanticsDataAccessException
    Exception thrown when a JDBC update affects an unexpected number of rows. Typically we expect an update to affect a single row, meaning it's an error if it affects multiple rows.
    Author:
    Rod Johnson, Juergen Hoeller
    See Also:
    Serialized Form
    • Constructor Detail

      • JdbcUpdateAffectedIncorrectNumberOfRowsException

        public JdbcUpdateAffectedIncorrectNumberOfRowsException(java.lang.String sql,
                                                                int expected,
                                                                int actual)
        Constructor for JdbcUpdateAffectedIncorrectNumberOfRowsException.
        Parameters:
        sql - the SQL we were trying to execute
        expected - the expected number of rows affected
        actual - the actual number of rows affected
    • Method Detail

      • getExpectedRowsAffected

        public int getExpectedRowsAffected()
        Return the number of rows that should have been affected.
      • getActualRowsAffected

        public int getActualRowsAffected()
        Return the number of rows that have actually been affected.