Results 1 to 2 of 2
  1. #1
    Manas Das is offline Member
    Join Date
    Jan 2009
    Posts
    8
    Rep Power
    0

    Default problem in retriving string data using jsp

    my code is

    ps=con.prepareStatement("SELECT * FROM LIBUCE WHERE BOOKID=?");
    String bk=request.getParameter("t7");
    ps.setString(4,bk);
    rs=ps.executeQuery();
    if(rs.next())
    {
    do
    {
    String nm=rs.getString(1);
    int rl=rs.getInt(2);
    String yr=rs.getString(3);
    String br=rs.getString(4);

    %>

    while retriving ROLL which is an integer ,its working fine.
    but in case of BOOKID which is a string data,i am getting error like
    sql statement not ended properly.
    plz help me how to do this with string.
    Is there anything other than getParameter() for retreiving strings.

  2. #2
    mtyoung is offline Senior Member
    Join Date
    Dec 2008
    Location
    Hong Kong
    Posts
    473
    Rep Power
    7

Similar Threads

  1. String Problem
    By gnomewise in forum New To Java
    Replies: 1
    Last Post: 10-19-2008, 01:37 PM
  2. Problem is getting the data to browser
    By freddieMaize in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 05-26-2008, 03:49 PM
  3. problem with fetching data
    By payal.mitra86 in forum JDBC
    Replies: 0
    Last Post: 05-24-2008, 02:29 PM
  4. Retriving image from database
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 02-09-2008, 09:41 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •