Re: "No results were returned by the query" exception

From: "Dave Cramer" <Dave(at)micro-automation(dot)net>
To: "'David Hancock'" <hancockd(at)cs(dot)man(dot)ac(dot)uk>, <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: "No results were returned by the query" exception
Date: 2002-03-22 03:19:36
Message-ID: 027101c1d150$65024140$807ba8c0@inspiron
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Actually, this only occurs when there is an error in the query. If there
are no results from the query

Ie select * from foo; returns nothing then you will get an empty result
set

If on the other hand there is an error in the query like a transaction
is in error, then the exception will be thrown

Dave

> -----Original Message-----
> From: pgsql-jdbc-owner(at)postgresql(dot)org
> [mailto:pgsql-jdbc-owner(at)postgresql(dot)org] On Behalf Of David Hancock
> Sent: Thursday, March 21, 2002 10:00 PM
> To: pgsql-jdbc(at)postgresql(dot)org
> Subject: [JDBC] "No results were returned by the query" exception
>
>
> Hi,
>
> Someone recently pointed out that a SQLException is thrown
> when a query
> returns no results. I have noticed this too. It used to be
> the case (driver version 6.x) that an empty ResultSet was
> returned, and no
> exception thrown.
>
> This new behaviour means that the Postgres driver behaves
> significantly differently to other JDBC drivers, and that
> code written for a generic JDBC connection doesn't work as
> expected with Postgres.
>
> Is this new behaviour a bug or a feature ?
>
> regards,
>
> Dave Hancock.
>
>
>
>
>
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>
>

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Serguei Mokhov 2002-03-22 05:38:36 Re: SQLException error code update?
Previous Message David Hancock 2002-03-22 02:59:36 "No results were returned by the query" exception