title: How to get parsed Date from Sqlite3 databse with Java?
body: <p>I am getting data from sqlite3 DB, by creating a model for my method with POJO. While retrieving data in a arraylist I am getting parse error for date. The date is defined as timestamp in the sqlite3 DB and while compiling it is throwing : <strong>Unparseable date: "2015-05-21 12:41:56" error</strong>. And while compiling query it is throwing : <strong>Error parsing time stamp</strong> I am using getDate() to retrieve date from the table.</p>
  
  <pre><code>public List&lt;EnergyMeter&gt; getAllData() {
      List&lt;EnergyMeter&gt; meters = new ArrayList&lt;EnergyMeter&gt;();
      try {
          LOGGER.info("############### FetchData.getAllData() start");
          Statement statement = DBConnection.getConnection().createStatement();
          ResultSet rs = statement.executeQuery("SELECT * FROM ENERGY_METER");
          LOGGER.info("############### FetchData.getAllData() meters:"+rs.getDate("CREATION_TIME"));
          while (rs.next()) {
              EnergyMeter energyMeter = new EnergyMeter();
              energyMeter.setDEVICE_IP(rs.getString("IP"));
              energyMeter.setCREATION_TIME(rs.getDate("CREATION_TIME"));
              energyMeter.setDESCRIPTION(rs.getString("DESCRIPTION"));
              energyMeter.setDEVICE_NAME(rs.getString("DEVICE_NAME"));
              energyMeter.setEMAIL_ID(rs.getString("EMAIL_ID"));
              energyMeter.setFDU_NAME(rs.getString("FDU_NAME"));
              energyMeter.setICBS(rs.getString("ICBS"));
              energyMeter.setLOCATION(rs.getString("LOCATION"));
              energyMeter.setMAC_ADDRESS(rs.getString("MAC_ADDRESS"));
              energyMeter.setMASTER_ID(rs.getString("MASTER_ID"));
              energyMeter.setPARAMETER(rs.getString("PARAMETER"));
              energyMeter.setPORT(rs.getString("PORT"));
              energyMeter.setPRODUCT_NAME(rs.getString("PRODUCT_NAME"));
              energyMeter.setSMTP(rs.getString("SMTP"));
              energyMeter.setSNMP(rs.getString("SNMP"));
              meters.add(energyMeter);
          }
      } catch (SQLException e) {
          e.printStackTrace();
      }
  
      LOGGER.info("############### FetchData.getAllData() end");
      return meters;
  }
  </code></pre>
  
  <p>I defined date as : <strong>private Date CREATION_TIME;</strong> in POJO.</p>