求助老师和大神
主要是GoddessDao类里面query函数的问题!
public List<Goddess> query() throws SQLException{
Connection conn = DBUdil.getConnection();
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("select user_name from imooc_goddess");
List<Goddess> gs=new ArrayList<Goddess>();
Goddess g = null;
while(rs.next())
{
g = new Goddess();
g.setUser_name(rs.getString("user_name"));
g.setAge(rs.getInt("age"));
gs.add(g);
}
return gs;
}