title: Using Prepared Statements to set Table Name
body: <p>I'm trying to use prepared statements to set a table name to select data from, but I keep getting an error when I execute the query.</p>
  
  <p>The error and sample code is displayed below.</p>
  
  <pre><code>[Microsoft][ODBC Microsoft Access Driver] Parameter 'Pa_RaM000' specified where a table name is required.
  
  
  
  private String query1 = "SELECT plantID, edrman, plant, vaxnode FROM [?]"; //?=date
  public Execute(String reportDate){
      try {
  
          Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
          Connection conn = DriverManager.getConnection(Display.DB_MERC);
          PreparedStatement st = conn.prepareStatement(query1);
          st.setString(1, reportDate);
          ResultSet rs = st.executeQuery();
  </code></pre>
  
  <p>Any thoughts on what might be causing this?</p>