title: How to UPDATE a field with a BIT datatype in mysql
body: <p>I would like to change the availability of an item in a database.</p>
  
  <pre><code>&lt;td&gt;&lt;select name="avl"&gt;
      &lt;option value="1" name="true "&gt;Available&lt;/option&gt;
      &lt;option value="0" name="false"&gt;Unavailable&lt;/option&gt;
      &lt;/select&gt;
  &lt;/td&gt;
  </code></pre>
  
  <p>Here is my sql statement to update the field.</p>
  
  <pre><code>&lt;sql:update dataSource="${dbsource}" var="count"&gt;
      UPDATE restaurant SET available = ? WHERE idrestaurant ='${param.id}'
      &lt;sql:param value="${param.avl}" /&gt;
  &lt;/sql:update&gt;
  </code></pre>
  
  <p>my datatype for the FIELD available is BIT.</p>
  
  <p>But I get this error.</p>
  
  <p>WARNING:   StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception
  com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'available' at row 1</p>