Re: Statement.executeQuery() and no results - Mailing list pgsql-jdbc

From Oliver Jowett
Subject Re: Statement.executeQuery() and no results
Date
Msg-id 20030723030133.GN31669@opencloud.com
Whole thread Raw
In response to Statement.executeQuery() and no results  (Sailesh Krishnamurthy <sailesh@cs.berkeley.edu>)
List pgsql-jdbc
On Tue, Jul 22, 2003 at 07:48:49PM -0700, Sailesh Krishnamurthy wrote:
>
> Folks
>
> When we run a query that produces no results, executeQuery() returns
> an exception instead of a ResultSet object for which the first call to
> next() returns false. (This is with a driver for pgsql 7.3.2)

JDBC distinguishes between statements that return a (possibly empty)
ResultSet (e.g. any SELECT) that should use executeQuery() and statements
that return no ResultSet (e.g. INSERT or CREATE TABLE) that should use
executeUpdate().

The JDBC javadoc is a bit clearer than the driver's javadoc on this.

-O

pgsql-jdbc by date:

Previous
From: Kris Jurka
Date:
Subject: Re: the IN clause saga
Next
From: Barry Lind
Date:
Subject: Re: Statement.executeQuery() and no results