开发者

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) .

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜