Duke Martin wrote:
> I think I understand what you are saying but what if the user interface
> (HTML page and buttons) are different for each user. The only thing I have
> control over is the name/value of each button. For example, say you had a
> music collection database that keeps track of each user's cd collection.
> When the user logs into your site, a list of all of his/her cd's is
> generated along with a button next to each cd title in the list. When the
> user clicks a button, a detailed description of the cd is displayed. For
> Garth Brooks button
> BackStreet Boys button
> I will also know if the user adds or deletes a cd. Will the solution you
> previously described handle this situation.
> Thanks for your help
In your situation, you can't use PreparedStatement.
Just use a plain Statement and concat the query via Strings yourself.
Do something like:
Statement stmt = con.createStatement();
ResultSet rst = stmt.executeQuery("select column1 from " + tableName + " where