Received: from smtp2.jakinternet.co.uk (proxy.jakinternet.co.uk [212.41.43.4]) by hub.org (8.10.1/8.10.1) with ESMTP id e6S5OpB81144 for ; Fri, 28 Jul 2000 01:24:51 -0400 (EDT) Received: from smtp.jakinternet.co.uk (smtp.jakinternet.co.uk [212.41.41.61]) by smtp2.jakinternet.co.uk (Postfix) with SMTP id 59D7FA76E6 for ; Fri, 28 Jul 2000 06:22:45 +0100 (BST) Received: from tabatha ([212.41.38.7]) by smtp.jakinternet.co.uk ; Fri, 28 Jul 2000 06:24:32 -0100 Message-ID: <000101bff854$8027da60$072629d4@retep.org.uk> From: "Peter Mount" To: , , Cc: References: <19016070071ED411B61300508BAC4B750418BF@exch1etix.encryptix.com> Subject: Re: JDBC problem with DELETE Date: Thu, 27 Jul 2000 18:51:59 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2615.200 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 X-Archive-Number: 200007/198 I'm not sure, but it might be loosing the quote somewhere. The proper safe way is to use PreparedStatement. I'll try it here just to make sure it isn't a bug though. Peter -- Peter T Mount peter@retep.org.uk, peter@retepdigital.com, me@petermount.com Homepage: http://www.retep.org.uk Contact details @ http://petermount.com PostgreSQL JDBC: http://www.retep.org.uk/postgres/ Java PDF generator: http://www.retep.org.uk/pdf/ ----- Original Message ----- From: To: ; Cc: Sent: Thursday, July 27, 2000 5:55 PM Subject: RE: [INTERFACES] JDBC problem with DELETE > Peter, > > The sql does work from psql. > > I also tried your suggestion about using PreparedStatement and that worked! > > Am I doing something wrong with Statement or is it a bug? > > Regards, > file://Dave > > > -----Original Message----- > > From: Peter Mount [mailto:petermount@it.maidstone.gov.uk] > > Sent: Wednesday, July 26, 2000 11:48 PM > > To: 'Dnesbitt@encryptix.com'; pgsql-interfaces@postgresql.org > > Subject: RE: [INTERFACES] JDBC problem with DELETE > > > > > > Does this happen when you run the sql from psql? > > > > How about using PreparedStatement instead of Statement? It > > would then handle > > the quoting correctly (which is what I'm thinking is going > > wrong here). > > > > Peter > > > > -- > > Peter Mount > > Enterprise Support > > Maidstone Borough Council > > Any views stated are my own, and not those of Maidstone > > Borough Council > > > > > > -----Original Message----- > > From: Dnesbitt@encryptix.com [mailto:Dnesbitt@encryptix.com] > > Sent: Thursday, July 27, 2000 5:41 AM > > To: pgsql-interfaces@postgresql.org > > Cc: Dnesbitt@encryptix.com > > Subject: [INTERFACES] JDBC problem with DELETE > > > > > > The following piece of code: > > > > stmt.executeUpdate("delete from friend where name='"+someName+"'"); > > > > is returning: > > > > SQLException: java.sql.SQLException: ERROR: Attribute > > 'John Doe' not > > found > > > > where someName is "John Doe". > > > > Any ideas? The row where name='John Doe' is definitely in > > the table and I > > can execute the statement without problems from psql. > > > > Thanks in advance for your help. > > > > Regards, > > file://Dave > >