This discussion is archived
1 Reply Latest reply: May 16, 2012 4:49 AM by Lethu RSS

How can i Convet String to oracle.jbo.domain.Date

869258 Newbie
Currently Being Moderated
Hi all,

How can i Convet String to oracle.jbo.domain.Date ?

Pls help its urgent?

Thanks
Amit
  • 1. Re: How can i Convet String to oracle.jbo.domain.Date
    Lethu Newbie
    Currently Being Moderated
    Hi

    Try this hope this helps.
            oracle.jbo.domain.Date current_date = null;
            oracle.jbo.domain.Date current_date1 = null;
            String date = null;
            try{
                PreparedStatement st = getDBTransaction().createPreparedStatement("select trunc(sysdate) from dual",1);
                ResultSet result = st.executeQuery();
                while (result.next()) {
                   date = result.getString(1);
                   System.out.println("Sysdate:"+date);
                }
                current_date = current_date1.toDate(date);
                
                System.out.println("Date Format:"+current_date);
            }catch(SQLException sqle){
                sqle.printStackTrace();
            }

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points