wood burning stoves 2.0*
The moose likes JSF and the fly likes  example of source code for insert a date Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » JSF
Bookmark " example of source code for insert a date" Watch " example of source code for insert a date" New topic
Author

example of source code for insert a date

asmaa kellal
Greenhorn

Joined: May 22, 2011
Posts: 18
Hello

I need a simple example of source code to insert a date into a database using jsf what do I have to put in backing bean and page jsf ( i need juste a date )

thanks
Milan Mendpara
Greenhorn

Joined: May 10, 2011
Posts: 7

it might work for you by casting it to GregorianCalendar .........

<ace:dateTimeEntry value="#{backBean.urDate}">
<f:convertDateTime dateStyle="short" pattern="MM/dd/yyyy" type="date" />
</ace:dateTimeEntry>


Calendar cal = Calendar.getInstance();
cal.setTime(urDate);
XMLGregorianCalendar xcal = DatatypeFactory.newInstance().newXMLGregorianCalendar((GregorianCalendar) cal);
obj.setDate(xcal);
// your code
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: example of source code for insert a date