空指针异怎么办
public static void main(String[] args) throws Exception {
GoddessDao g=new GoddessDao();
List<Goddess> gs=g.query();
for (Goddess goddess : gs) {
System.out.println(goddess.getUser_name()+","+goddess.getAge());
}
空指针异常咋整?
on in thread "main" java.lang.NullPointerException
at com.imooc.dao.GoddessDao.query(GoddessDao.java:30)
at com.imooc.action.GoddessAction.main(GoddessAction.java:16)