title: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Incorrect date value: '' for column 'Date_Of_Birth' at row 1
body: <p>I'm trying to update the personal detail of a user through a java panel.Panel has fields like user_id(autogenerated),name,date of birth.
  problem is when i enter nothing to the date of birth field in java panel and then save it. It gives me the above mentioned error.
  i tried to verify it by inserting null to the date of birth(Date datatype) field directly using the mysql database.There it gives no error.
  Why is it not taking null string when i insert through java panel but is taking when insert directly using mysql.</p>
  
  <pre><code>CREATE TABLE `userpersonaldetail` (
    `User_Id` int(10) unsigned NOT NULL auto_increment,
    `Name` varchar(45) default NULL,
    `Date_Of_Birth` date default NULL,
    `Address` varchar(300) default NULL,
    `Phone` varchar(20) default NULL,
    `Mobile` varchar(20) default NULL,
    `Email` varchar(50) default NULL,
    PRIMARY KEY  (`User_Id`),
    CONSTRAINT `FK_userpersonaldetail_1` FOREIGN KEY (`User_Id`) REFERENCES `usermaster` (`User_Id`)
  ) 
  </code></pre>
  
  <p>And the portion of the code where exception occurs is:</p>
  
  <pre><code>  try
       {
          con=(Connection) DBConnection.getConnection();
          pstmt=(PreparedStatement) con.prepareStatement("Update userpersonaldetail set "+
                 "name=?,date_of_birth=?,address=?,phone=?,mobile=?,email=? where user_id=?");
  
              pstmt.setInt(7,perBean.getUserId());
              pstmt.setString(1,perBean.getName());
              pstmt.setString(2,perBean.getDateOfBirth());
              pstmt.setString(3,perBean.getAddress());
              pstmt.setString(4,perBean.getPhone());
              pstmt.setString(5,perBean.getMobile());
              pstmt.setString(6,perBean.getEmail());
  
              int i=pstmt.executeUpdate();
   }
  </code></pre>
  
  <p>here perBean is the javaBean which retrieves values from the gui.In one of the test case i kept the date_of_birth text box null  which is giving error while storing in DB.</p>