diff --git a/jdbc/src/main/java/org/springframework/jdbc/core/JdbcTemplate.java b/jdbc/src/main/java/org/springframework/jdbc/core/JdbcTemplate.java index 8222fe6715..32cc316a5c 100644 --- a/jdbc/src/main/java/org/springframework/jdbc/core/JdbcTemplate.java +++ b/jdbc/src/main/java/org/springframework/jdbc/core/JdbcTemplate.java @@ -11,6 +11,7 @@ import javax.sql.DataSource; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.dao.DataAccessException; public class JdbcTemplate { @@ -108,10 +109,9 @@ public int update(final String sql, final Object... parameters) { pstmt.setObject(i, parameter); i++; } - pstmt.executeUpdate(); - return 1; + return pstmt.executeUpdate(); } catch (SQLException e) { - return 0; + throw new DataAccessException(); } } }