title: hibernate - retrieving and saving date in mysql database in format I want
body: <p>I am storing data in MySQL Database using hibernate in this way. </p>
  
  <pre><code>@Column(name="CREATION_DATE")
  private Date creation_date;
  </code></pre>
  
  <p>I am entering the date in dd-mm-yyyy format using :</p>
  
  <pre><code>    String str_date = request.getParameter("document_date");
      DateFormat df = new SimpleDateFormat("dd-mm-yyyy");
      Date date = null;
      try {
          date = df.parse(str_date);
      } catch (ParseException e1) {
          System.out.println("Exception occurred in parsing date : "+e1);
      }
  </code></pre>
  
  <p>But when the date enters database it is in completely different format : for eg. if date entered is 22/2/2015 then date stored is 0022-01-03. And also I am unable to prevent time getting saved in the database, even though I have used TemporalType.DATE. Please help, because this has taken too much of my time ! </p>