Safe way to use table name as parameter in JDBC query
<p>What is the safe way how to put table name as parameter into SQL query? You cannot put table name as parameter using <a href="http://docs.oracle.com/javase/8/docs/api/java/sql/PreparedStatement.html" rel="noreferrer">PreparedStatement</a>. Concatenating string to execute query with dynamic table name using <a href="http://docs.oracle.com/javase/8/docs/api/java/sql/Statement.html" rel="noreferrer">Statement</a> is possible, however it is not recommended because of risk of SQL injection. What is the best approach to do this?</p>