Helpful Information
 
 
Category: XM
XML -> Pojo -> MySql conversion

In an XML feed I get a date and time in the format: "2011-07-02T23:05:25Z" which gets saved in a POJO and now I need to write out to a MySQL database where the field is calling for a datetime.

Using statement.setString results in Data truncation error for an invalid datetime format.

Using statement.setTimestamp(Timestamp.valueof(dateValue)) yields an IllegalArgumentException.

statement.setDate seems more appropriate, but not sure how to supply a Date given the above format.

Any suggestions?