title: Can I ignore or suppress warnings in JDBC for MySQL?
body: <p>I have an <code>INSERT INTO ... ON DUPLICATE KEY UPDATE ...</code> statement that executes fine (but with warnings) in the <code>mysql&gt;</code> prompt:</p>
  
  <pre><code>mysql&gt; INSERT INTO ... ON DUPLICATE KEY UPDATE ... ;
  Query OK, 2 rows affected, 2 warnings (0.00 sec)
  Warning (Code 1364): Field 'x' doesn't have a default value
  </code></pre>
  
  <p>However, when I try to execute the same statement via JDBC the warning shows up as an <code>SQLException</code> and no rows are updated:</p>
  
  <pre><code>java.sql.SQLException: Field 'x' doesn't have a default value
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1055)
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3536)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3468)  
    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1957)
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2107)
    at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2648)
    at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2086)
    at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:1365)
  </code></pre>
  
  <p><strong>Is there a JDBC or mysql connector setting or command to ignore or suppress these warnings?</strong></p>
  
  <p>I'm using MySQL Community Server 5.1.31 with MySQL connector 5.1.8 and Java 1.5.0_24.</p>