title: How to use Joda-Time with java.sql.Timestamp
body: <p>I Have a <a href="http://docs.oracle.com/javase/tutorial/jdbc/basics/prepared.html" rel="noreferrer">prepared statement</a></p>
  
  <pre><code>INSERT INTO mst(time) VALUES (?);
  </code></pre>
  
  <p>where time is of type <a href="http://www.postgresql.org/docs/current/static/datatype-datetime.html" rel="noreferrer">Timestamp</a> in a <a href="http://en.wikipedia.org/wiki/PostgreSQL" rel="noreferrer">PostgreSQL</a> database.<br>
  I am inserting a <a href="http://www.joda.org/joda-time/" rel="noreferrer">Joda-Time</a> <a href="http://www.joda.org/joda-time/apidocs/org/joda/time/DateTime.html" rel="noreferrer">DateTime</a> object, or I should say I am trying to. I can find no way to convert the DateTime object into a <a href="http://docs.oracle.com/javase/7/docs/api/java/sql/Timestamp.html" rel="noreferrer">java.sql.Timestamp</a>. I have read the Joda-Time docs and see no reference to this.</p>
  
  <p>Thanks.</p>