title: convert XMLGregorianCalendar to java.sql.Timestamp
body: <p>I'm trying to assign a XMLGregorianCalendar date to a java.sql.Timestamp var, like this...</p>
  
  <pre><code>var1.setTimeStamp(Timestamp.valueOf(var2.getXMLGregorianCalendar().toString()))
  </code></pre>
  
  <p>But apparently, this is not working, and throws an exception...</p>
  
  <blockquote>
    <p>java.lang.IllegalArgumentException: Timestamp format must be yyyy-mm-dd hh:mm:ss[.fffffffff]</p>
  </blockquote>
  
  <p>And I've tried this, as well:</p>
  
  <pre><code>var1.setTimeStamp((Timestamp) var2.getXMLGregorianCalendar().getTime())
  </code></pre>
  
  <p>but... </p>
  
  <blockquote>
    <p>java.lang.ClassCastException: java.util.Date cannot be cast to java.sql.Timestamp</p>
  </blockquote>
  
  <p>Any ideas..? Thanks!</p>