RE: Why?? executeQuery() & exception: "No results were returnedby the query."

From: Joe Shevland <J(dot)Shevland(at)eclipsegroup(dot)com(dot)au>
To: "'pgsql-jdbc(at)postgresql(dot)org'" <pgsql-jdbc(at)postgresql(dot)org>
Subject: RE: Why?? executeQuery() & exception: "No results were returnedby the query."
Date: 2001-05-13 12:37:47
Message-ID: C56487636E5CD4119B1E00D0B789098ADA29A4@MEL-EXCH1
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

I believe it should be an exception condition actually, in that the original
post was using executeQuery() with a statement that was an
update/insert/delete, for which executeUpdate() should be used. Sorry if
this argument has been played out, mailbox hell at the mo'.

executeQuery() of course won't mind if the result set doesn't contain any
rows.

If you do have to decide at runtime which one to use (ad-hoc user SQL stuff
perhaps), then the execute() method can be used to perform both types and
the meta-data interrogated.

Regards,
Joe

> -----Original Message-----
> From: pgsql-jdbc-owner(at)postgresql(dot)org
> [mailto:pgsql-jdbc-owner(at)postgresql(dot)org]On Behalf Of Jeff Duffy
> Sent: Wednesday, 9 May 2001 12:05 PM
> To: pgsql-jdbc(at)postgresql(dot)org
> Subject: Re: [JDBC] Why?? executeQuery() & exception: "No results were
> returnedby the query."
>
>
>
> On Tue, 8 May 2001 15:32:19 -0400 (EDT), Bruce Momjian alluded:
>
> >
> > Are you saying that this "no result" error is required by the JDBC
> > standard, or is it a PostgreSQL bug?
>
> The JDBC specification does not address this level of
> granularity, but I am
> not aware of any other JDBC implementation that considers a
> ResultSet of 0
> rows to be an exception condition. So I vote bug.
>
> Jeff
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to
> majordomo(at)postgresql(dot)org)
>

Browse pgsql-jdbc by date

  From Date Subject
Next Message Subhramanya Shiva 2001-05-13 16:43:10 ...How to remove ?
Previous Message Joe Shevland 2001-05-13 12:27:23 RE: Displaying/Pulling Images using JDBC ...