Received: from tsmtp1.mail.isp (mailhost.teleline.es [195.235.113.141] (may be forged)) by hub.org (8.10.1/8.10.1) with ESMTP id e8SF1Zp12716 for ; Thu, 28 Sep 2000 11:01:35 -0400 (EDT) Received: from ORDENADOR14 ([193.153.196.59]) by tsmtp1.mail.isp (Netscape Messaging Server 4.1) with SMTP id G1LQZO02.M00 for ; Thu, 28 Sep 2000 16:59:48 +0200 Message-ID: <006801c0295c$dd7d99a0$0e64a8c0@STARTUP.COM> From: "Daniel Gayo Avello" To: References: <003a01c02958$4ce7e2a0$0e64a8c0@STARTUP.COM> <39D358A3.2412A8AF@lysator.liu.se> Subject: RE: SQLException from Postgres JDBC Date: Thu, 28 Sep 2000 16:56:22 +0200 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: 200009/113 Thanks both of you (Jens and Peter), yes, I'm using executeQuery and should be executeUpdate()... Newbie mistakes. Thanks again. Dani > > In fact, the operations are done but they don't return any results so > > a exception is catch by the servlet. > > Do this means that the data is inserted/deleted, even though you get an > exception? Then I would guess you handle the returned result in the > wrong way, or something like it. > > ///Jens Carlberg > Which method are you using to perform the INSERT or DELETE? > > You should be using executeUpdate() rather than executeQuery() because > executeUpdate() doesn't expect a ResultSet to be returned, and > executeQuery should throw an SQLException when it fails to get one. > > Peter