About getJdbcTemplate().update(..)
yael,
From ,
the method update clearly documented that if there is any error, there
will be an exception thrown: DataAccessException. Catching that will
signify errors.
The return code from update means you have a successful run of the
update. but the value will depends on what type of update SQL you used.
Some SQL will run sucessful, but return 0, and some will return number
or records got affected. That you will have to read on your Database
manual to figure out.
对于不同的DB这是个问题。但是我看过上面的链接,其中说明如下,看来是可以一试的:
update
public int update( sql)
throws
- Description copied from interface:
- Issue a single SQL update operation (such as an insert, update or delete statement).
- Specified by:
in interface
- Parameters:
sql
- static SQL to execute
- Returns:
- the number of rows affected
- Throws:
- if there is any problem.
阅读(18098) | 评论(0) | 转发(0) |