title: Convert and save date with spring mvc
body: <p>I have in spring a form with date when I enter the data in field date with datepicker and I give you save receipt the date format as follows E MMM dd HH: mm: ss Z yyyy example Mon Jun 18 00:00:00 IST 2012 The tranformo with</p>
  
  <pre><code>         SimpleDateFormat formDate = new SimpleDateFormat ("dd/MM/yyyy");
           String birthday = formDate.format (emp.getBirthday ());
  </code></pre>
  
  <p>Returns a string if I then do</p>
  
  <pre><code>         Emp.setBirthday (formDate.parse (birthday));
  </code></pre>
  
  <p>I will return it E MMM dd HH: mm: ss Z yyyy and I need it in Date dd/MM/YYYY format to save it in the database</p>
  
  <p>I have the class entity employed</p>
  
  <pre><code>public class Employees  implements java.io.Serializable {
   private int employeeId;
   private String firstName;
   private String lastName;
   private Date birthday;
  
  //getter and setter
  
  }
  </code></pre>
  
  <p>and controller</p>
  
  <pre><code>@RequestMapping(value = {"/new"}, method = RequestMethod.POST)
      public String save(ModelMap modelMap, @ModelAttribute("emp") Employees emp, BindingResult result) {
              SimpleDateFormat formaDate = new SimpleDateFormat("dd/MM/yyyy");
              String birthday = formaDate.format(emp.getBirthday());
  
              emp.setBirthday(formaDate.parse(birthday));
  
              employeesServices.saveRecord(emp);
  }
  </code></pre>
  
  <p>To save gives me the following error</p>
  
  <blockquote>
    <p>Value greater than specified precision allowed for this column</p>
  </blockquote>
  
  <p>I am new enspring mvc</p>
  
  <p>Translated with google translate</p>