title: How to convert DateTimeFormatter to Timestamp sql formate
body: <p>I am trying to insert DateTimeFormatter to Timestamp in my table Tab1 using JDBC, </p>
  
  <pre><code>String d="2020-03-19T21:19:32:921Z";
   DateTimeFormatter dateTimeFormatterUtc = DateTimeFormat.forPattern("yyyy-MM-dd'T'HH:mm:ss:SSSr3");
   DateTime tD = dateTimeFormatterUtc.parseDateTime(d);
   I have set the date into my dao
   dao.setTRD(transactionOpenDateTime);
  
  
   String INSERT_AUDIT_SQL1= "insert into Tab1 (TD) value (?);";
   PreparedStatement preparedStatement = con.prepareStatement(INSERT_AUDIT_SQL1);
   preparedStatement.setDate(1,(Date) dao.getTRD().toDate());
  </code></pre>
  
  <p>I am getting error like below</p>
  
  <pre><code>java.lang.IllegalArgumentException: Invalid format: "2020-04-16T08:12:16.016+05:30[Asia/Calcutta]" is malformed at ".016+05:30[Asia/Calcutta]"
  Exception in thread "main" java.lang.NullPointerException
      at com.manthan.dao.ConnectionDao.main(ConnectionDao.java:60)
  </code></pre>