spring的jdbcTemplate 返回值为list 带参数


	 * */
	public boolean findStuCourseById(int uid, int cid) {
	

		

		String sql = "select * from 7east_usercourse_right where userid=? and courseid=?";
		BeanPropertyRowMapper<UserCourse> argTypes = new BeanPropertyRowMapper<UserCourse>(UserCourse.class);

		Object[] args = new Object[] { uid, cid };
		List<UserCourse> list = getJdbcTemplate().query(sql, args, argTypes );
		
		
		
		
		if(list!=null){
			return list.size()>0?true:false;
		}else{
			return false;
		}
	}


你可能感兴趣的:(java,spring,sql)