Two Laptop Bag
The moose likes JSF and the fly likes  example of source code for insert a date Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » JSF
Reply 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://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: example of source code for insert a date
 
Similar Threads
SQL Column Date Type insertion problem
converting dateformat compatible to oracle date
insert date into database using jsf
java.sql getTimestamp
Code Conventions