On Tue, 10 Jan 2006, Jeffrey Leegon wrote:
> String tableName = "\"AdultData\"";
> String tempSql = "SELECT [some stuff] FROM ? WHERE [some conditions]";
> query = conn.prepareStatement(tempSql);
> query.setString(1, tableName);
>
> java.sql.SQLException: ERROR: syntax error at or near "$1"
> at
You cannot use placeholders for stuctural parts of your query, only
parameters. The server cannot create a prepared plan if it doesn't even
know what table you are operating on.
Kris Jurka