Thanx to Mark, Jozef, Peter Huber, David Godbey, Sergio and Anthony Tagunov for their replies. Wuz very informative.
Priya. ----- Original Message ----- From: Ramaswamy, Rathnapriya (CORP, GTS, <mailto:[EMAIL PROTECTED]> L531741) To: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> Sent: Thursday, January 24, 2002 2:11 PM Subject: Re: JDBC question - PreparedStatement Thanx Mark, but what I actually wanted to know was....(Sorry I did not convey properly) 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=?; I wanted to know, if setting values in where clause directly rather than setting it in the PreparedStatement object has any adv/disadv? Is it better to always set the values in the PreparedStatement Object? Hope I have put across my doubt now. Thanx, Priya "THIS E-MAIL MESSAGE ALONG WITH ANY ATTACHMENTS IS INTENDED ONLY FOR THE ADDRESSEE and may contain confidential and privileged information. If the reader of this message is not the intended recipient, you are notified that any dissemination, distribution or copy of this communication is strictly Prohibited. If you have received this message by error, please notify us immediately, return the original mail to the sender and delete the message from your system." ___________________________________________________________________________ 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