Hello all,
I'm trying to use a prepared statement to query a table. The name of the table to be queried, is passed into the prepared statement.
Here's a sample of my code:
stmt = oraConn.prepareStatement(SDO_FILTERS);
stmt.setString(1, tableName);
ors = (OracleResultSet) stmt.executeQuery();
- - - - - - - - - - - - - - - -
public static final
String SDO_FILTERS =
"SELECT * FROM ? ";
When I run the code I get an invalid table name error. I think that the problem might be that the setString method stores the tableName with inverted commas around it.
Can anybody suggest a way around this problem please ?
Thanks in advance,
Trish.