The short answer is that you cannot parameterize a tablename in a prepared statement. You have to contruct the sql with string concatenation. Basically prepared statements are used for column values and not for the table names.
The best I can think of is to use string.format
like this:
String sql = String.format("select * from $1%s", yourtable);