title: Avoiding CheckStyle magic number errors in JDBC queries
body: <p>I am working on a group project for class and we are trying out CheckStyle.</p>
  
  <p>I am fairly comfortable with Java but have never touched JDBC or done any database work before this.</p>
  
  <p>I was wondering if there is an elegant way to avoid magic number errors in preparedStatement calls, consider:</p>
  
  <pre><code>        preparedStatement = connect.prepareStatement("INSERT INTO shows "
                  + "(showid, showtitle, showinfo, genre, youtube)"
                  + "values (default, ?, ?, ?, ?);");
          preparedStatement.setString(1, title);
          preparedStatement.setString(2, info);
          preparedStatement.setString(3, genre);
          preparedStatement.setString(4, youtube);
          result = preparedStatement.executeUpdate();
  </code></pre>
  
  <p>The setString methods get flagged as magic numbers, so far I just added the numbers 3-10 or so to the ignore list for magic numbers but I was wondering if there was a better way to go about inserting those values into the statement.  I also beg you for any other advice that comes to mind seeing that code, I'd like to avoid developing any nasty habits, e.g. should I be using Statement or is PreparedStatement fine? Will that let me refer to column names instead? Is that ideal? etc...</p>
  
  <p>Thanks!</p>