title: Why does Spring's JDBC Templates doesn't use the tables default value
body: <p>I have a table in MYSQL and I am using JDBC Templates to do an insert into that table.</p>
  
  <p>One of the columns has a default value, and I am not specifying it in the <code>Map&lt;String, Object&gt; parameters</code> map.</p>
  
  <p>I am getting an exception <code>Column 'colName' cannot be null</code>.</p>
  
  <p>Can anyone explain this please?</p>
  
  <p>Thanks</p>
  
  <p>*<em>Edit: code *</em></p>
  
  <blockquote>
  <pre><code>contactDetailsInsertTemplate = new SimpleJdbcInsert( dataSource ).withTableName("contactdetails").usingGeneratedKeyColumns("contactcode");
  Map&lt;String, Object&gt; parameters = new HashMap&lt;String, Object&gt;();
  Number newId = contactDetailsInsertTemplate.executeAndReturnKey(parameters);
  </code></pre>
  </blockquote>