hi,
I have a java servlet that interacts with a MySQL database. The following
is a description of my program and my problem:
I have an HTML page with buttons on it. The name/value pair submitted when
a button is pushed corresponds to a name of a table on the database.
Therefore, I am using a prepared statement and using the name/value from the
button as a parameter in the sql select statement. The statement reads:
select column1 from ? where id='104';
The problem is that I get an sql exception syntax error. The query that the
server actually receives looks like this:
select column1 from 'button_name' where id='104';
The problem is the quotes around the table name. How do I prevent this
error? Is there anyway to parameterize the table name in an sql statement?
Please help. Any info appreciated.
Duke