2-6,通过id查询女神信息的这个代码怎么跟上一节的对不上啊
public List<Goddess> query() throws Exception {
Connection conn = DBUtil.getConnection();
Statement stmt = conn.createStatement();
ResultSet rs = stmt
.executeQuery("select user_name,age from imooc_goddess");
List<Goddess> gs = new ArrayList<Goddess>();
Goddess g = null;
while (rs.next()) {
g = new Goddess();
// String username=rs.getString("user_name");
// g.setUserName(username);
g.setUser_name(rs.getString("user_name"));
g.setAge(rs.getInt("age"));
gs.add(g);
}
return gs;
}