This is just plain old Java syntax error, the operator "+" in Java is used to concatenate String objects, remove the extra plus after "a" in all the three statements and you should be good to go,
if(c.equals("BillNo")){
/*--error--*/ rs = stmt.executeQuery("select * from orders where billNo="+a+);
}else if(c.equals("UserId")){
/*--error--*/ rs = stmt.executeQuery("select * from orders where userid="+a+);
}
else if(c.equals("ProductId")){
/*--error--*/ rs = stmt.executeQuery("select * from orders where productid="+a+);
}
Also just a point to remember next time wrap your code inside code tags as shown below it will give you syntax highlighting as shown above.
[code=java]
// Your code here
[/code]
Last edited by stephen84s; Aug 21st, 2009 at 3:06 am.
Reputation Points: 653
Solved Threads: 151
Nearly a Posting Virtuoso
Offline 1,316 posts
since Jul 2007