Received: from iremia.univ-reunion.fr (iremia.univ-reunion.fr [194.199.73.10]) by hub.org (8.9.3/8.9.3) with ESMTP id HAA71760 for ; Wed, 19 Apr 2000 07:59:31 -0400 (EDT) (envelope-from Guillaume.Rousse@univ-reunion.fr) Received: from agathe (agathe.univ.run [10.10.2.24]) by iremia.univ-reunion.fr (8.9.1a/jtpda-5.3.1/jlo(98)) with SMTP id PAA29212 ; Wed, 19 Apr 2000 15:58:36 +0400 (GMT+4) From: Guillaume Rousse Organization: Université de la Réunion To: pgsql-interfaces@postgresql.org Subject: RE: Is this usage correct ? Date: Wed, 19 Apr 2000 16:03:38 +0400 X-Mailer: KMail [version 1.0.28] Content-Type: text/plain References: <1B3D5E532D18D311861A00600865478C70C4D0@exchange1.nt.maidstone.gov.uk> In-Reply-To: <1B3D5E532D18D311861A00600865478C70C4D0@exchange1.nt.maidstone.gov.uk> Cc: Peter Mount MIME-Version: 1.0 Message-Id: <00041916051801.15060@agathe> Content-Transfer-Encoding: 8bit X-Archive-Number: 200004/147 Just as i use PreparedStatement elsewhere in the code, i'd like to use the same pattern. Le mer, 19 avr 2000, Peter Mount a écrit : > In theory it would be ok, but as PreparedStatement extends Statement, > why cause the extra overhead and just use Statement? > > Peter > > -- > Peter Mount > Enterprise Support > Maidstone Borough Council > Any views stated are my own, and not those of Maidstone Borough Council. > > > > -----Original Message----- > From: Guillaume Rousse [mailto:Guillaume.Rousse@univ-reunion.fr] > Sent: Wednesday, April 19, 2000 10:47 AM > To: pgsql-interfaces@postgresql.org > Subject: [INTERFACES] Is this usage correct ? > > > Is it correct to use a preparedStatement with no variable element, as > this: > PreparedStatement stmp=conn.prepareStatement("delete from table where > oid="+oid); > stmt.excuteUpdate(); > > Or is it mandatory to use : > PreparedStatement stmp=conn.prepareStatement("delete from table where > oid=?"); > stmt.setInt(1,oid); > stmt.excuteUpdate(); > > -- > Guillaume Rousse > Iremia - Université de la Réunion > > Sleep doesn't exists. Just lack of cafeine. -- Guillaume Rousse Iremia - Université de la Réunion Sleep doesn't exists. Just lack of cafeine.