老师我的程序出现“”java.lang.NullPointerException“”怎么办?
package com.jdbc.action;
import java.util.List;
import com.jdbc.dao.GoddessDao;
import com.jdbc.model.Goddess;
public class GoddesAction {
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());
}
}
}
下面是运行结果: