-
queryForInt
@Deprecated public int queryForInt(String sql, Object[] args, int[] argTypes) throws DataAccessException
Deprecated.Description copied from interface:JdbcOperations
Query given SQL to create a prepared statement from SQL and a list of arguments to bind to the query, resulting in an int value.The query is expected to be a single row/single column query that results in an int value.
-
Specified by:
-
queryForInt
in interfaceJdbcOperations
Parameters:
-
sql
- SQL query to execute -
args
- arguments to bind to the query -
argTypes
- SQL types of the arguments (constants fromjava.sql.Types
)
Returns:
- the int value, or 0 in case of SQL NULL Throws:
-
IncorrectResultSizeDataAccessException
- if the query does not return exactly one row, or does not return exactly one column in that row -
DataAccessException
- if the query fails
See Also:
-
JdbcOperations.queryForInt(String)
,Types
-
spring 的JDBCTemplate的 queryForInt用法
最新推荐文章于 2023-10-05 20:15:25 发布