stmt.executeQuery ("SELECT * FROM staff WHERE staffid ="+id);

:-(.

"wap@asl" wrote:

> Thank you Jeff & Anand.
>
> Yes, you were right.  I had case problem.  That is solved.  Another small
> problem.
>
> I am declaring following two variables and giving the following sql query.
>
> String id = request.getParameter("staffid");
> String pass = request.getParameter("password");
> .....
> .....
> ResultSet rs = stmt.executeQuery ("SELECT * FROM staff WHERE staffid =
> 'id'");
>
> Now, I want only that record to show up where staffid matches one given by
> the user.  But in the SQL, variable id is not taken.  If I put pure text ex.
> ResultSet rs = stmt.executeQuery ("SELECT * FROM staff WHERE staffid =
> 'ks01'");
> where ks01 is a staffid in the database, everything works fine.  But if the
> user is giving ks01 from the earlier page, it is not taking.  Am I calling
> the variable wrongly?
>
> Thanx :-) & Regards,
>
> Kaushal.
>
> ===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to