You can’t. You need to contruct the sql with string concatenation/placeholder with String.format. prepared statement is for the column values not for table name.
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
- Using Prepared Statements to set Table Name
- right syntax to use near ‘?’
- Is it possible to create variables at runtime in Java?
- Having a Column name as Input Parameter of a PreparedStatement
- How to use prepared statement for select query in Java?
- Hours and seconds are lost when storing a date in the database [closed]
- How to convert java.util.Date to java.sql.Date?
- Dates with no time or timezone component in Java/MySQL
- Efficient way to do batch INSERTS with JDBC
- Java: Insert multiple rows into MySQL with PreparedStatement
- How to use an arraylist as a prepared statement parameter [duplicate]
- How to create change listener for variable?
- Postgres data type cast
- How to enable logging for SQL statements when using JDBC
- What are the pros and cons of performing calculations in sql vs. in your application
- Cleanest way to build an SQL string in Java
- Is there away to generate Variables’ names dynamically in Java?
- mysql prepared statement error: MySQLSyntaxErrorException
- Spring JPA @Query with LIKE
- how to call a java method using a variable name?
- Is it possible to dynamically build a multi-dimensional array in Java?
- Why do I get a “variable might not have been initialized” compiler error in my switch block?
- PreparedStatements and performance
- Java String variable setting – reference or value?
- Database independence through JDBC in java
- How to escape colon `:` within a native SQL query in Hibernate?