求助老師和大神
主要是GoddessDao類里面query函數(shù)的問題! ?
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;
}
2015-03-10
錯(cuò)誤提示是沒有age列,查一下數(shù)據(jù)庫(kù)列是否匹配