-
[无名弟子]李浩0
public void getuser4(String name){
String sql = "select age from user where name = ?";
int age = jdbcTemplate.queryForList(sql,new Object[]{name});
System.out.println(age);
不应该返回int,应该返回List,毕竟你自己都知道是queryForList;
你试试:List age = jdbcTemplate.queryForList(sql,new Object[]{name});
编辑于2018-11-02
- 去第 页