title: JDBC dynamic query, only put value to string if not -1
body: <p>I have a problem with JDBC and java. 
  I have a Query like this:</p>
  
  <pre class="lang-sql prettyprint-override"><code>String updateSql = "UPDATE league SET season=?, playedMatches=?, percentHomeWins=?, percentDraws=?, percentAwayWins=?, averageGoalsPerGame=?, averageGoalsHomePerGame=?, averageGoalsAwayPerGame=?, percentOverOne=?, percentOverTwo=?, percentOverThree=?, percentBothTeamsScored=?, scoredGoalsTotal=?  " + whereClause + " and country='" + l.getCountry() + "'";
  </code></pre>
  
  <p>all values after "season" can either be a number >= 0 or -1. -1 means, that there is no value. the values come from a class that holds data (like an object model).
  I want only the values in my query, which are >= 0. The other one should not be in the query, because they replace data in the database, which they should not.</p>
  
  <p>Can anyone help me archiving this?</p>