I am trying to show the details inserted into my database on a weppage
I have tried converting the date to sql date
public static List<Detail> getAllRecords(){
List<Detail> list = new ArrayList<Detail>();
try{
Connection con = getConnection();
PreparedStatement ps = con.prepareStatement("select * from studentDetails");
ResultSet rs = ps.executeQuery();
while(rs.next()){
Detail u = new Detail();
java.sql.Date dbSqlDate = rs.getDate("dob");
u.setPassword(rs.getInt("password"));
u.setName(rs.getString("name"));
u.setLastname(rs.getString("lastname"));
u.setUsername(rs.getString("username"));
u.setEmail(rs.getString("email"));
u.setAddress(rs.getString("address"));
System.out.println("dbSqlDate=" + dbSqlDate);
u.setAge(rs.getInt("age"));
list.add(u);
}
}catch(Exception e){System.out.println(e);}
return list;
}
I expect the output to be 02/03/2000 , but it's not working