title: SQLite column with space in name
body: <p>I try to access a SQLLite database in my war in which some columns have space in their name.</p>
  
  <p>I saw the previous question <a href="https://stackoverflow.com/questions/14019275/read-data-from-sqlite-where-column-name-contains-spaces">Read data from SQLite where column name contains spaces</a> on SO but the solution doesn't work :</p>
  
  <p>I know I'm supposed to escape the column names with either ``, "" or [] but none of this works for me, I get the following exception with every one of the escape characters, with space or no space in the column name :</p>
  
  <pre><code>java.sql.SQLException: no such column: '[class of worker]'
  java.sql.SQLException: no such column: '"age"'
  </code></pre>
  
  <p>same with ` with doesn't escape well on SO</p>
  
  <p>At the same time, the request works well with unescaped columns names without space (such as 'age' or 'education')</p>
  
  <p>and the request in my code seem well formed :</p>
  
  <pre><code>SELECT DISTINCT `class of worker`, COUNT(*) as countt, ROUND(CAST(SUM(age) AS FLOAT)/COUNT(*),3) as avgage FROM census_learn_sql GROUP BY `class of worker` ORDER BY countt DESC
  </code></pre>
  
  <p>Here's the code accessing the db :</p>
  
  <pre><code>public Results getColumnValues(String column){
  
      column = "`" + column + "`"; //handle space in column names
      String sql = "SELECT DISTINCT "+column+", COUNT(*) as countt, ROUND(CAST(SUM(age) AS FLOAT)/COUNT(*),3) as avgage FROM census_learn_sql GROUP BY "
                      +column+" ORDER BY countt DESC";
  
      Results results = new Results();
      int count = 0;
      int clippedOutRows = 0;
  
      try (Connection conn = this.connect();
           Statement stmt  = conn.createStatement();
           ResultSet rs    = stmt.executeQuery(sql)){
  
          while (rs.next()) {
              if (count &gt;= 100){
                  clippedOutRows += rs.getInt("countt");
              }
              else {
                  results.getResults().add(new RowResult(rs.getString(column),
                          rs.getInt("countt"),
                          rs.getDouble("avgage")));
              }
  
              count++;
          }
  
          results.setClippedOutRows(clippedOutRows);
          results.setClippedOutValues(count &gt; 99 ? count - 99 : 0);
      } catch (SQLException e) {
          System.out.println(e.getMessage());
      }
  
      return results;
  }
  </code></pre>
  
  <p>And here's my pom file dependencies :</p>
  
  <pre><code>&lt;properties&gt;
          &lt;!-- maven-compiler-plugin --&gt;
          &lt;maven.compiler.target&gt;1.8&lt;/maven.compiler.target&gt;
          &lt;maven.compiler.source&gt;1.8&lt;/maven.compiler.source&gt;
          &lt;version.javaee&gt;7.0&lt;/version.javaee&gt;
          &lt;version.resteasy&gt;3.0.10.Final&lt;/version.resteasy&gt;
          &lt;version.jackson&gt;2.4.1&lt;/version.jackson&gt;
          &lt;version.junit&gt;4.11&lt;/version.junit&gt;
          &lt;version.assertj&gt;1.6.1&lt;/version.assertj&gt;
          &lt;version.commons&gt;3.2.1&lt;/version.commons&gt;
      &lt;/properties&gt;
  
  
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.jboss.resteasy&lt;/groupId&gt;
              &lt;artifactId&gt;resteasy-jaxrs&lt;/artifactId&gt;
              &lt;version&gt;${version.resteasy}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.jboss.resteasy&lt;/groupId&gt;
              &lt;artifactId&gt;resteasy-servlet-initializer&lt;/artifactId&gt;
              &lt;version&gt;${version.resteasy}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.jboss.resteasy&lt;/groupId&gt;
              &lt;artifactId&gt;resteasy-jackson-provider&lt;/artifactId&gt;
              &lt;version&gt;${version.resteasy}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;javax&lt;/groupId&gt;
              &lt;artifactId&gt;javaee-api&lt;/artifactId&gt;
              &lt;version&gt;${version.javaee}&lt;/version&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;commons-collections&lt;/groupId&gt;
              &lt;artifactId&gt;commons-collections&lt;/artifactId&gt;
              &lt;version&gt;${version.commons}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;junit&lt;/groupId&gt;
              &lt;artifactId&gt;junit&lt;/artifactId&gt;
              &lt;version&gt;${version.junit}&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.assertj&lt;/groupId&gt;
              &lt;artifactId&gt;assertj-core&lt;/artifactId&gt;
              &lt;version&gt;${version.assertj}&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;!-- SQLite JDBC library --&gt;
          &lt;dependency&gt;
             &lt;groupId&gt;org.xerial&lt;/groupId&gt;
             &lt;artifactId&gt;sqlite-jdbc&lt;/artifactId&gt;
             &lt;version&gt;3.8.11.2&lt;/version&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  </code></pre>
  
  <p>I don't see what I'm doing wrong here, is it a dependency problem ?</p>
  
  <p>Thanks in advance for your help</p>