Re: [flexcoders] MySql timestamp column type and Flex DateField
I had to format the string from ActionScript to pass to the Value Object as follows. var eDate:Date = Event_DateCol.selectedDate; var event_Date:String = String(eDate.getFullYear()) + - + String(eDate.getMonth()+1) + - + String(eDate.getDate()) + 00:00:00.0; var parameters:* = { method: Insert, Event_Date: event_Date,..., }; then in the VO public void setEvent_Date(String Event_Date) { if ((Event_Date != null) (Event_Date.length() 0)) { this.Event_Date = Timestamp.valueOf(Event_Date); } } I hope this helps someone else. Mike Oliver wrote: How do I tie a DateField control to a Value Object with a Timestamp column in the database. -- View this message in context: http://www.nabble.com/MySql-timestamp-column-type-and-Flex-DateField-tp21196170p21209213.html Sent from the FlexCoders mailing list archive at Nabble.com.
[flexcoders] MySql timestamp column type and Flex DateField
How do I tie a DateField control to a Value Object with a Timestamp column in the database. I am getting java.lang.IllegalArgumentException: Timestamp format must be -mm-dd hh:mm:ss.f at java.sql.Timestamp.valueOf(Unknown Source) at com.corent.odicx.goms.dao.OrdersVO.setEvent_Date(OrdersVO.java:93) the DateField format string only modifies the display. the selectedDate output doesn't seem to have any methods that take a format string to format for Timestamp. I suppose I could just pull the year month and day out of the selected date and format my own string but that seems like a waste and I am basically lazy. anybody have a cool way to handle this? Ollie -- View this message in context: http://www.nabble.com/MySql-timestamp-column-type-and-Flex-DateField-tp21196170p21196170.html Sent from the FlexCoders mailing list archive at Nabble.com.