Hi Guys,
I have to get the value from the first record in the ResulstSet for Date field in
jsp. I have to print a message in jsp if the date field is null but it throws NullPointer Exception and I see the message in server console that I have written in catch block. Can you please help me with this? Below is the code snippet.
================================================================
ResultSet sentNotification = pn_bean.getStatus(itemId, con);
if(sentNotification.next(){
try{
if(sentNotification .getTimestamp("date_notification_sent") != null){
date_notification= sentNotification.getTimestamp("date_notification_sent"); // date_notification_sent is Date filed in DB table
}
}catch(Exception e){
System.out.println("NullPointer Exception")
}
}
if(date_notification){
"PRINT MESSAGE"
}
=================================================================
Thanks in advance
/Amit