title: setObject() method of PreparedStatement
body: <p>Can I use the <code>setObject()</code> method of <code>PreparedStatement</code> for all datatypes (like <code>String</code>, <code>int</code> or <code>double</code>)?</p>
  
  <p>What are the potential problems if I use that?</p>
  
  <pre><code>protected void fillStatement(PreparedStatement stmt, Object[] params)
          throws SQLException {
  
          if (params == null) {
              return;
          }
  
          for (int i = 0; i &lt; params.length; i++) {
              if (params[i] != null) {
                  stmt.setObject(i + 1, params[i]);
              } else {
                  stmt.setNull(i + 1, Types.OTHER);
              }
          }
      }
  </code></pre>