title: An arithmetic expression with a DATETIME value is invalid while using PreparedStatement with Arithmetic calculation in sql later
body: <p>I have the following sql query:</p>
  
  <pre><code>    SELECT COUNT(*) FROM PC_DATA
      WHERE PC_DATE BETWEEN ? AND (? + 4 MONTHS)
      AND UPPER(PC_TYPE) LIKE UPPER(?)
  </code></pre>
  
  <p>Now I trying to set the values of the <code>Dates</code> by the following code in <strong>JAVA</strong>:</p>
  
  <pre><code>Date start = new Date(quaterStart.getTimeInMillis());
  
  stmt.setDate(1, start);
  stmt.setDate(2, start);
  stmt.setString(3, "%" + type + "%");
  </code></pre>
  
  <p>And when I run it I get the following exception: <a href="http://www.sqlerror.de/db2_sql_error_-182_sqlstate_42816.html" rel="nofollow">DB2 SQL Error: SQLCODE=-182, SQLSTATE=42816, SQLERRMC=null, DRIVER=4.16.53</a></p>
  
  <p>While I try to run this sql query from a console in the following way, it runs without any issues:</p>
  
  <pre><code> SELECT COUNT(*) FROM PC_DATA
    WHERE PC_DATE BETWEEN  DATE('2015-01-01') AND (DATE('2015-01-01') + 4 MONTHS)
    AND UPPER(PC_TYPE) LIKE UPPER('%laptop%');
  </code></pre>
  
  <p>What am I doing wrong? Thank you.</p>