From danielgayo@terra.es Thu Sep 28 14:28:32 2000 Received: from tsmtp3.ldap.isp (mailhost.teleline.es [195.235.113.141] (may be forged)) by hub.org (8.10.1/8.10.1) with ESMTP id e8SESQ797661 for ; Thu, 28 Sep 2000 10:28:32 -0400 (EDT) Received: from ORDENADOR14 ([193.153.196.59]) by tsmtp3.ldap.isp (Netscape Messaging Server 4.1) with SMTP id G1LPEZ05.9J3 for ; Thu, 28 Sep 2000 16:25:47 +0200 Message-ID: <003a01c02958$4ce7e2a0$0e64a8c0@STARTUP.COM> From: "Daniel Gayo Avello" To: Subject: SQLException from Postgres JDBC Date: Thu, 28 Sep 2000 16:27:58 +0200 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0037_01C02969.102D8F20" 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/109 This is a multi-part message in MIME format. ------=_NextPart_000_0037_01C02969.102D8F20 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi, everybody! I've got a problem with Postgres JDBC driver and perhaps som= ebody could help me. I'm using JDK 1.2.2, JSK 2.0, PostgreSQL 7.0.2 and Apa= che JServ 1.1.2 and my servlets throw a SQLException when I try to perform = a INSERT or DELETE operation... In fact, the operations are done but they don't return any results so a exc= eption is catch by the servlet. Does somebody know the way to avoid this? Thanks in advance, Dani ------=_NextPart_000_0037_01C02969.102D8F20 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi, everybody! I've got a problem with Pos= tgres=20 JDBC driver and perhaps somebody could help me. I'm using JDK 1.2.2, JSK 2.= 0,=20 PostgreSQL 7.0.2 and Apache JServ 1.1.2 and my servlets throw a SQLExceptio= n=20 when I try to perform a INSERT or DELETE operation...
 
In fact, the operations are done but they = don't=20 return any results so a exception is catch by the servlet.
 
Does somebody know the way to avoid=20 this?
 
Thanks in advance, Dani
------=_NextPart_000_0037_01C02969.102D8F20-- From jenca@lysator.liu.se Thu Sep 28 14:44:06 2000 Received: from fep03-svc.swip.net (fep03.swip.net [130.244.199.131]) by hub.org (8.10.1/8.10.1) with ESMTP id e8SEi6p04326 for ; Thu, 28 Sep 2000 10:44:06 -0400 (EDT) Received: from lysator.liu.se ([212.151.0.33]) by fep03-svc.swip.net (InterMail vM.5.01.01.01 201-252-104) with ESMTP id <20000928144357.AFC28405.fep03-svc.swip.net@lysator.liu.se> for ; Thu, 28 Sep 2000 16:43:57 +0200 Message-ID: <39D358A3.2412A8AF@lysator.liu.se> Date: Thu, 28 Sep 2000 16:41:39 +0200 From: Jens Carlberg X-Mailer: Mozilla 4.7 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 CC: pgsql-interfaces@postgresql.org Subject: Re: SQLException from Postgres JDBC References: <003a01c02958$4ce7e2a0$0e64a8c0@STARTUP.COM> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200009/110 > Daniel Gayo Avello wrote: > > Hi, everybody! I've got a problem with Postgres JDBC driver and > perhaps somebody could help me. I'm using JDK 1.2.2, JSK 2.0, > PostgreSQL 7.0.2 and Apache JServ 1.1.2 and my servlets throw a > SQLException when I try to perform a INSERT or DELETE operation... Hi! It is hard to comment when you dont supply any example code that demonstrates your problem. If you could send a code block in which the error occurs it would be much easier. > 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 From mstephenson@tirin.openworld.co.uk Thu Sep 28 14:50:35 2000 Received: from tirin.openworld.co.uk (tirin.openworld.co.uk [194.207.107.233]) by hub.org (8.10.1/8.10.1) with ESMTP id e8SEoZp06779 for ; Thu, 28 Sep 2000 10:50:35 -0400 (EDT) Received: from localhost (mstephen@localhost) by tirin.openworld.co.uk (8.9.3/8.9.3) with ESMTP id PAA23843 for ; Thu, 28 Sep 2000 15:50:29 +0100 Date: Thu, 28 Sep 2000 15:50:29 +0100 (BST) From: Michael Stephenson X-Sender: mstephen@tirin.openworld.co.uk cc: pgsql-interfaces@postgresql.org Subject: Re: SQLException from Postgres JDBC In-Reply-To: <003a01c02958$4ce7e2a0$0e64a8c0@STARTUP.COM> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200009/112 > Hi, everybody! I've got a problem with Postgres JDBC driver and > perhaps somebody could help me. I'm using JDK 1.2.2, JSK 2.0, > PostgreSQL 7.0.2 and Apache JServ 1.1.2 and my servlets throw a > SQLException when I try to perform a INSERT or DELETE operation... > > In fact, the operations are done but they don't return any results so > a exception is catch by the servlet. Just guessing because your description is so vague.. If you use executeQuery instead of executeUpdate you'll get the exception postgresql.stat.noresult, which seems to be fit with what you're describing. Michael Stephenson From danielgayo@terra.es Thu Sep 28 15:01:35 2000 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 From peter@retep.org.uk Thu Sep 28 14:50:05 2000 Received: from anchor-post-33.mail.demon.net (anchor-post-33.mail.demon.net [194.217.242.91]) by hub.org (8.10.1/8.10.1) with ESMTP id e8SEo5p06657 for ; Thu, 28 Sep 2000 10:50:05 -0400 (EDT) Received: from maidast.demon.co.uk ([158.152.22.37]) by anchor-post-33.mail.demon.net with esmtp (Exim 2.12 #1) id 13ef0d-0009lA-0X; Thu, 28 Sep 2000 15:50:04 +0100 Received: from localhost (peter@localhost) by maidast.demon.co.uk (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id RAA06667; Thu, 28 Sep 2000 17:00:14 +0100 Date: Thu, 28 Sep 2000 17:00:14 +0100 (BST) From: Peter Mount X-Sender: peter@maidast.demon.co.uk To: Daniel Gayo Avello cc: pgsql-interfaces@postgresql.org Subject: Re: SQLException from Postgres JDBC In-Reply-To: <003a01c02958$4ce7e2a0$0e64a8c0@STARTUP.COM> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200009/111 On Thu, 28 Sep 2000, Daniel Gayo Avello wrote: > Hi, everybody! I've got a problem with Postgres JDBC driver and > perhaps somebody could help me. I'm using JDK 1.2.2, JSK 2.0, > PostgreSQL 7.0.2 and Apache JServ 1.1.2 and my servlets throw a > SQLException when I try to perform a INSERT or DELETE operation... > > In fact, the operations are done but they don't return any results so > a exception is catch by the servlet. > > Does somebody know the way to avoid this? 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. An alternative (if you don't know what the query will be) is execute(), but you then have to handle ResultGet accordingly. Peter -- Peter T Mount peter@retep.org.uk http://www.retep.org.uk PostgreSQL JDBC Driver http://www.retep.org.uk/postgres/ Java PDF Generator http://www.retep.org.uk/pdf/