Re: Statement.executeQuery() and no results

Поиск
Список
Период
Сортировка
От Oliver Jowett
Тема Re: Statement.executeQuery() and no results
Дата
Msg-id 20030723030133.GN31669@opencloud.com
обсуждение исходный текст
Ответ на Statement.executeQuery() and no results  (Sailesh Krishnamurthy <sailesh@cs.berkeley.edu>)
Список 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 по дате отправления:

Предыдущее
От: Kris Jurka
Дата:
Сообщение: Re: the IN clause saga
Следующее
От: Barry Lind
Дата:
Сообщение: Re: Statement.executeQuery() and no results