Hello see that the value is with in single quotes.
For example try in the following manner
String city=req.getParameter("mcity");
ResultSet rs = Statement.executeQuery("SELECT * FROM mytable WHERE
cityname='"+city+"'");
It will work i experienced the same problem before and i fixed it as above
and it works fine
Jayakumar
>From: Moloy Biswas <[EMAIL PROTECTED]>
>Reply-To: "A mailing list for discussion about Sun Microsystem's Java
> Servlet API Technology." <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: help in servlet report
>Date: Wed, 8 Mar 2000 19:15:13 +0530
>
>hello all
>
>I am facing a problem, I am trying to get some input from the user and
>based on the input I want to make a resultset with the Select statement
>in my servlet.
>
>Supposing I am taking a cityname as input from using getParameter() and
>then I am putting in the where clause of the select statement. its not
>working ...
>
>my select statement is somewhat like this
>
>select fname,lname from contact,comp where contact.id = comp.id and
>comp.city = req.getParameter("mcity");
>
>where mcity is the text input in my html
>
>please help
>
>Moloy
>
>
>--------------------------------------------------------------
>SREI INTERNATIONAL FINANCE LTD., CALCUTTA, INDIA
>
>___________________________________________________________________________
>To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
>of the message "signoff SERVLET-INTEREST".
>
>Archives: http://archives.java.sun.com/archives/servlet-interest.html
>Resources: http://java.sun.com/products/servlet/external-resources.html
>LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html