I dont know whether it is possible or not,But here is my question:
I am getting 13 input fields,based on input
Ex:String firstname=request.getParameter("firstname"); ......
I have to prepare sql where clause like if (firstname!=null){ where firstname=’test’ and ..}
Any advises for this kind of scenario.
Regards,
Raj
If I understand correctly, you would like to generate queries dynamically, depending on the value of input fields. There are frameworks helping to do that, like MyBatis. But you could roll your own solution with prepared statements :
You could make it even better by supporting SQL types, by using the builder pattern, etc., but you should get the idea with this simple example.