Monday, November 19, 2012

ADF : How to Convert String into oracle.jbo.domain.Date ?

 How to Convert String into oracle.jbo.domain.Date ?

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;
}