code: protected void fillStatement(PreparedStatement stmt, Object[] params, int[] paramTypes)
          throws SQLException {
  
          if (params == null) {
              return;
          }
  
          if ((paramTypes != null) && (params.length != paramTypes.length)) {
              throw new IllegalArgumentException("Sizes of params and paramTypes must be equal!");
          }
  
          for (int i = 0; i < params.length; i++) {
              if (params[i] != null) {
                  if (paramTypes == null)
                      stmt.setObject(i + 1, params[i]);
                  else
                      stmt.setObject(i + 1, params[i], paramTypes[i]);
              } else {
                  // VARCHAR works with many drivers regardless
                  // of the actual column type.  Oddly, NULL and
                  // OTHER don't work with Oracle's drivers.
                  if (paramTypes == null)
                      stmt.setNull(i + 1, Types.VARCHAR);
                  else
                      stmt.setNull(i + 1, paramTypes[i]);
              }
          }
      }
docs: Fill the <code>PreparedStatement</code> replacement parameters with
  the given objects.
  @param stmt PreparedStatement to fill
  @param params Query replacement parameters; <code>null</code> is a valid
  value to pass in.
  @param paramTypes Query replacement parameters types; <code>null</code> is a valid
  value to pass in.
  @throws java.sql.SQLException if a database access error occurs