Ramaswamy, Rathnapriya (CORP, GTS, L531741) wrote:

> String query1="update table1 set field1 = ?, field2= ? where field3
> ='"+someBeanInstance.getName()+"' and field4 =
> '"+someBeanInstance.getDesc()+"'";
>
> String query2="update table1 set field1 = ?, field2 = ? where field3 = ? and
> field4=?;


    The second is better because of portability - if you change your DB
engine and the new engine will have syntax using " instead of ' for
string separation, you must rewrite first query string but the second
can be still the same.


    Regards,

J.Ch.
--
Ing. Jozef Chocholacek                  Qbizm Technologies, Inc.
Chief Project Analyst                   ... the art of internet.
________________________________________________________________
Kralovopolska 139                          tel: +420 5 4124 2414
601 12 Brno, CZ      http://www.qbizm.com  fax: +420 5 4121 2696

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to