A table name can’t be used as a parameter. It must be hard coded. So you can do something like:
private String query1 = "SELECT plantID, edrman, plant, vaxnode FROM [" + reportDate + "?]";
More Related Contents:
- Using setDate in PreparedStatement
- How can I get the SQL of a PreparedStatement?
- How does a PreparedStatement avoid or prevent SQL injection?
- Variable column names using prepared statements
- How to use a tablename variable for a java prepared statement insert [duplicate]
- right syntax to use near ‘?’
- Having a Column name as Input Parameter of a PreparedStatement
- How to use prepared statement for select query in Java?
- String variable in java to get and store the json array in table column
- How to get the insert ID in JDBC?
- java.util.Date vs java.sql.Date
- How to call a stored procedure from Java and JPA
- Running a .sql script using MySQL with JDBC
- Prevent SQL injection attacks in a Java program
- Java Date – Insert into database
- Most efficient conversion of ResultSet to JSON?
- LINQ for Java tool [closed]
- SQL prepared statement how to select via multiple possible menu selections?
- Class.forName(JDBC_DRIVER) no longer needed?
- Is there any good dynamic SQL builder library in Java? [closed]
- Bulk insert in Java using prepared statements batch update
- PreparedStatement setNull(..)
- How can I detect a SQL table’s existence in Java?
- Java – Storing SQL statements in an external file [closed]
- JPA Select latest instance for each item
- Should I use composite primary keys or not?
- How to use SELECT IN clause in JDBCTemplates?
- Searching between dates in SQL with JDBC?
- Getting last record from mysql
- How to avoid OOM (Out of memory) error when retrieving all records from huge table?