Skip site navigation (1) Skip section navigation (2)

RE: SQLException from Postgres JDBC

From: "Daniel Gayo Avello" <danielgayo(at)terra(dot)es>
To: <pgsql-interfaces(at)postgresql(dot)org>
Subject: RE: SQLException from Postgres JDBC
Date: 2000-09-28 14:56:22
Message-ID: 006801c0295c$dd7d99a0$0e64a8c0@STARTUP.COM (view raw or flat)
Thread:
Lists: pgsql-interfaces
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




In response to

pgsql-interfaces by date

Next:From: Peter MountDate: 2000-09-28 16:00:14
Subject: Re: SQLException from Postgres JDBC
Previous:From: Michael StephensonDate: 2000-09-28 14:50:29
Subject: Re: SQLException from Postgres JDBC

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group