0

i m workin with jsp's

i am doing a project on online movie ticket booking system.
i encountered a problem when i started executing code for seat booking....
let me tell u my prob....

i m tryin to execute a query like this....

select s.seatno,'"+seat+"' from booking where s.screenid='101';

seat variable is a string which i got from a checkbox from the previous page...i.e.

<input type="checkbox" name="check" value="<%=sno%>">

i got the seat value from this,

String seat=request.getParameter("check");
out.println(seat);

when i print the value in "seat" i get a value as 's1' which is correct...
the value in "seat" i.e 's1' is one of the column names in my table...
i want to retrieve the data from dat column...
so i used this,

String showno=rst.getString("'"+seat+"'");

when i print the value in showno i m not gettin the data from the column....

i m still getting 's1' which is the column name...
but i want the data from the column...

------------------------------------------------------------------
plz do reply...
i hv been struggling with this since 2 weeks...

plz send me the code if suck kind of code exists...or else
send me any other different way to work with it....

Edited by peter_budo: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks)

2
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by jwenting
-1

man... i explained it in the best way i could...
according to me i dont find any gramatical mistakes in my post...
i dont understand wat code tags u want...
i gave d code with absolutely no syntax errors...
including explanation abt y n how (of the values) .
i might have missed inserting quotes on one of the variables in my explanation section....

i might have confused u wid my explanation...

neways if u can still help me then
tell me if this works...

String showno=rst.getString("'"+seat+"'");

wat will be the value in 'showno'

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.