how to update selective fields in jsp (leaving some fields unchanged)
i have creat开发者_运维问答ed a page with text boxes, details are:
house no: streetname: cityname: pincode: contact : bloodgroup :
my requirement is to update the details of user.
i wrote an update query,but with that all details are updating.
If the user dont want to change only contact n the remaining details should b the same, then how to do that?
i know how to update, but how to get the old details as it is if user wont update it.
For this you need to build the SQL query dynamically using a StringBuffer inside your DAO layer . Then update only those fields
Update table Tablename (col1 , col2) values( val1, vale2) .
精彩评论