报这个错是为啥Exception in thread "main" java.lang.NullPointerException at com.spring.dao.Goddess_dao.query(Goddess_dao.java:28) at com.spring.action.GoddessAction.main(GoddessAction.java:10)
package com.spring.action;
import java.util.List;
import com.spring.dao.*;
import com.spring.model.Goddess;
public class GoddessAction {
public static void main(String[] args) throws Exception {
Goddess_dao g = new Goddess_dao();
List<Goddess> gs = g.query();
for (Goddess goddess : gs) {
System.out.println(goddess.getUser_name()+","+goddess.getAge());
}
}
}