老师,请帮我解答一哈,为什么输出的list的内容会是这样的bean.Empt@1e1798c1,达不到应有的结果。数据库连接正常。。就是list输出有问题。
List<Empt> list=new ArrayList<Empt>();
String sql="select * from empt";
try {
PreparedStatement stat=conn.prepareStatement(sql);
ResultSet rs=stat.executeQuery(sql);
while(rs.next()){
Empt empt1=new Empt();
empt1.setUserName(rs.getString("userName"));
empt1.setUserPass(rs.getString("userPass"));
empt1.setId(rs.getString("id"));
empt1.setSex(rs.getString("sex"));
empt1.setBirthDate(rs.getString("birthDate"));
empt1.setAdmin1(rs.getString("admin"));
empt1.setDetail(rs.getString("detail"));
empt1.setDate(rs.getString("updateTime"));
list.add(empt1);
}