title: How to append star character * in StringBuilder?
body: <p>I am writing a program for sql database and need to build a <code>select</code> query based on selected columns. When no columns are selected I want to use <code>select * from</code> syntax. How do I append * to StringBuilder?</p>
  
  <pre><code>ArrayList&lt;String&gt; columns;
  StringBuilder queryBuilder = new StringBuilder("select ");
  
  ... 
  
  if (columns == null || columns.size() == 0) {
      queryBuilder.append(Character.toString ((char) 42));
  } else {
      for (String name : columns) {
          queryBuilder.append(name);
          queryBuilder.append(", ");
      }
  }
  queryBuilder.setLength(queryBuilder.length() - 2);
  queryBuilder.append(" from ");
  queryBuilder.append(tableName);
  </code></pre>
  
  <p>I also tried <code>("*")</code> <code>("\*")</code> <code>("\\*")</code> <code>('*')</code> <code>((char)42)</code> but none of those work. The output I get from StringBuilder is <code>select from tableName</code></p>