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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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

Browse pgsql-interfaces by date

  From Date Subject
Next Message Peter Mount 2000-09-28 16:00:14 Re: SQLException from Postgres JDBC
Previous Message Michael Stephenson 2000-09-28 14:50:29 Re: SQLException from Postgres JDBC