I am trying to fetch date from database that i have previously stored in it using datepicker but i am unable to do so . i have tried using java.sql.date but it is returning null and is not setting on the datepicker
public void usearch(ActionEvent event)
{
ResultSet resultSet= null;
resultSet=dbcon.dbcon("Select * from Employees where employee_id='"+ upempid.getText() +"'");
try {
if(resultSet.next())
{
upempname.setText(resultSet.getString("Employee_name"));
upempaddress.setText(resultSet.getString("Address"));
upempfname.setText(resultSet.getString("father_name"));
upempage.setText(resultSet.getString("Age"));
upempcnic.setText(resultSet.getString("CNIC"));
upempemail.setText(resultSet.getString("Email"));
java.sql.Date date= resultSet.getDate("JOINING_DATE");
System.out.println(date);
// upempjoining.setValue(date.toLocalDate());
upempphone.setText(resultSet.getString("phone_number"));
upemptype.setText(resultSet.getString("employee_type"));
uptransportid.setText(resultSet.getString("transport_id"));
}
} catch (SQLException e) {
e.printStackTrace();
}
}
Comments
Post a Comment