This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
The situation is that, i have a demo shopping cart, in which user click on checkbox(es) to add item(s) in his/her cart. I retrieve all checkbox(es) value from Form & insert it in a array object. That array object then transfer into Session. However i m trying to make a Select statment which pick those prod no. which is in array object. for example: "Select * from product where prodno = " + ProdNo[i] Something like that....but i m not sure about this query... ------------------ regards, Asif Kilwani
Looks like this case is an excellent candidate for a PreparedStatement(looks like you are going to loop to get the array values):
Joined: Dec 04, 2001
I tried your code..but if i don't insert while(rs.next()) after ResultSet rst = ps.executeQuery() it gives me "Invalidate Cursor State" and i also noticed that if array contain two or three values, it gives me same error. In George Reese Book, he used same stament but place CONCUR_READ_ONLY. PreparedStatement stmt = con.prepareStatement("Select * from prodno Where prodno =?", ResultSet.CONCUR_READ_ONLY); but that code gave me error... how i can maintain the multiple ResultSet?