problem with null in prepared statement
843859Mar 22 2007 — edited Apr 17 2007hi all,
i am getting some values from my jps page using request.getParameter("") and setting them in query in a servlet for fetching records from oracle db.
i have query something like this:
select product_id from product p, product_types pt where upper(pt.product_name) = nvl(?,upper(pt.product_name)).
if the user on jsp page doesn't input any product name then i m setting "null" explicitly.
but the real issue is how can i set ? to a null (not null string) (just like prepareStatement.setString (1,"abc");) because the query will return all the records if ? is set to null (not "null") and i want exactly that.
any hints???
regards