JdbcTemplate类中的List query(String sql, RowMapper rowMapper) 执行String类型参数提供的SQL语句,并通过RowMapper返回一个List类型的结果()
举一反三
- 以下有关JdbcTemplate中常用的query()方法说法正确的是 A: List query(String sql, RowMapper rowMapper)执行String类型参数提供的SQL语句,并通过RowMapper返回一个List类型的结果 B: List query(String sql,Object[] args,RowMapper rowMapper)使用Object[]的值来设置SQL语句中的参数值,采用RowMapper回调方法可以直接返回List类型的数据 C: queryForObject(String sql,RowMapper rowMapper,Object… args) 将args参数绑定到SQL语句中,并通过RowMapper返回一个Object类型的单行记录 D: queryForList(String sql,Object[] args, class<T> elementType)该方法可以返回多行数据的结果,但必须是返回列表,elementType参数返回的是List元素类型。
- 在JdbcTemplate类中execute(String sql)方法能够完成执行SQL语句的功能()
- JdbcTemplate类中的int update(String sql)方法是最简单的update方法重载形式,它直接执行传入的SQL语句,并返回受影响的行数()
- 欲构造ArrayList类的一个实例,元素类型为String,作为List类型的对象,下列哪个方法是正确的 ? A: ArrayList myList=new Object(); B: List<String> myList=new ArrayList<String> (); C: ArrayList<String> myList=new List<String> (); D: List<String> myList=new List<String> ();
- 以下有关JdbcTemplate类中常用的update()方法说明正确的是 A: int update(String sql):该方法是最简单的update方法重载形式,它直接执行传入的SQL语句,并返回受影响的行数 B: int update(PreparedStatementCreator psc):该方法执行从PreparedStatementCreator返回的语句,然后返回受影响的行数 C: int update(String sql,PreparedStatementSetter pss): 该方法通过PreparedStatementSetter设置SQL语句中的参数,并返回受影响的行数 D: int update(String sql,Object... args): 该方法使用Object…设置SQL语句中的参数,要求参数不能为NULL,并返回受影响的行数