This is a way of converting a given date as a string to oracle.jbo.domain.Date.
/**
*Converts a String to oracle.jbo.domain.Date
* @param aDate
* @return oracle.jbo.domain.Date or null.
*/
public oracle.jbo.domain.Date castToJBODate(String aDate){
DateFormat formatter;
java.util.Date date;
if(aDate!=null){
try {
formatter = new SimpleDateFormat("dd/MM/yyyy");
date = formatter.parse(aDate);
java.sql.Date sqlDate = new java.sql.Date(date.getTime());
oracle.jbo.domain.Date jboDate = new oracle.jbo.domain.Date(sqlDate);
return jboDate;
} catch (ParseException e) {
e.printStackTrace();
}
}
return null;
}
Thanks for the help
ReplyDeleteHi Dimitrios,
ReplyDeleteThis is perfect. It worked.
Thanks a ton,
Abhi
Very good..........Thanks
ReplyDelete