RE: JDBC problem with DELETE

From: Peter Mount <petermount(at)it(dot)maidstone(dot)gov(dot)uk>
To: "'Dnesbitt(at)encryptix(dot)com'" <Dnesbitt(at)encryptix(dot)com>, pgsql-interfaces(at)postgresql(dot)org
Subject: RE: JDBC problem with DELETE
Date: 2000-07-27 06:48:07
Message-ID: 1B3D5E532D18D311861A00600865478CF1B166@exchange1.nt.maidstone.gov.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

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(at)encryptix(dot)com [mailto:Dnesbitt(at)encryptix(dot)com]
Sent: Thursday, July 27, 2000 5:41 AM
To: pgsql-interfaces(at)postgresql(dot)org
Cc: Dnesbitt(at)encryptix(dot)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,
//Dave

Responses

Browse pgsql-interfaces by date

  From Date Subject
Next Message Cedar Cox 2000-07-27 07:56:33 Re: JDBC problem with DELETE
Previous Message S.A.Pamungkas 2000-07-27 05:37:20 result not appear