List:MySQL and Java« Previous MessageNext Message »
From:Christian Mack Date:August 3 1999 12:27pm
Subject:Re: JDBC problem
View as plain text  
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
> example:
> 
> 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
> Duke

Hi Duke

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
id='104'");
...

Tschau
Christian

Thread
JDBC problemDuke Martin30 Jul
  • Re: JDBC problemMark Matthews30 Jul
  • Re: JDBC problemADIB MOTIWALA30 Jul
RE: JDBC problemR.)30 Jul
Re: JDBC problemDuke Martin30 Jul
  • Re: JDBC problemChristian Mack3 Aug