title: JDBC PreparedStatement - Using the same argument, is it possible?
body: <p>I'm using an "insert or update" query such as the one below:</p>
  
  <pre><code>        String sql = 
              "INSERT INTO servlets (path, applicationId, startTime, numOfRequests, totalResponseTime, totalBytes)" +
              "VALUES (?, ?, NOW(), 1, ?, ?)" +
              "ON DUPLICATE KEY UPDATE numOfRequests = numOfRequests + 1, " +
              "totalResponseTime = totalResponseTime + ?, totalBytes = totalBytes + ?";
  </code></pre>
  
  <p>I'm using prepared statements and fill it with the relevant arguments in the following manner:</p>
  
  <pre><code>        statement = connection.prepareStatement(sql);
          statement.setString(1, i_ServletModel.GetPath());
          statement.setInt(2, i_ServletModel.GetApplicationId());
          statement.setLong(3, i_RequestStats.GetResponseTime());
          statement.setLong(4, i_RequestStats.GetBytes());
          statement.setLong(5, i_RequestStats.GetResponseTime());
          statement.setLong(6, i_RequestStats.GetBytes());
  </code></pre>
  
  <p>Notice that argument 3 is exactly the same as argument 5 and argument 4 is exactly the same as argument 6 since they require the same value in the query above.</p>
  
  <p>Is there anything I can change, either in the query or in the arguments filling methods to avoid such an "ugly" syntax?</p>