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.
> ---------------------------(end of
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to
pgsql-jdbc by date
|Next:||From: Subhramanya Shiva||Date: 2001-05-13 16:43:10|
|Subject: ...How to remove ?|
|Previous:||From: Joe Shevland||Date: 2001-05-13 12:27:23|
|Subject: RE: Displaying/Pulling Images using JDBC ...|