Uses a JDBC Statement, not a PreparedStatement. If you want to execute a static query with a PreparedStatement, use the overloaded queryForInt
method with null
as argument array.
This method is useful for running static SQL with a known outcome. The query is expected to be a single row/single column query that results in an int value. @param sql SQL query to execute @return the int value, or 0 in case of SQL NULL @throws IncorrectResultSizeDataAccessException if the query does not returnexactly one row, or does not return exactly one column in that row @throws DataAccessException if there is any problem executing the query @see #queryForInt(String,Object[])
The query is expected to be a single row/single column query that results in an int value. @param sql SQL query to execute @param paramSource container of arguments to bind to the query @return the int value, or 0 in case of SQL NULL @throws org.springframework.dao.IncorrectResultSizeDataAccessException if the query does not returnexactly one row, or does not return exactly one column in that row @throws org.springframework.dao.DataAccessException if the query fails @see org.springframework.jdbc.core.JdbcTemplate#queryForInt(String)
|
|