请教 spring 2.5中的jdbctemplate.query的问题。
我的代码如下:
String sql="select DEPT_ID as dept_id, DEPT_NAME as dept_name, DEPT_FATH_ID as dept_fath_id, DEPT_LEVEL as dept_level from M_DEPT where DEPT_ID=?"; Object[] obj=new Object[1]; obj[0]=new Integer(dept_id); List<Dept> deptList = this.getJdbcTemplate().query(sql,obj,new BeanPropertyRowMapper(Dept.class)); if(!deptList.isEmpty()) { return deptList.iterator().next(); }else { return null; }