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

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 (view raw, whole thread or download thread mbox)
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

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.


> -----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)

pgsql-jdbc by date

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

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