Re: strange problem

From: Kris Jurka <books(at)ejurka(dot)com>
To: "Gilbert, Antoine" <AGilbert(at)korem(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: strange problem
Date: 2006-01-25 20:20:32
Message-ID: Pine.BSO.4.61.0601251518480.20277@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On Wed, 25 Jan 2006, Gilbert, Antoine wrote:

> I have a single PostGIS table in PostgreSQL
> This table has like 500000 records
> I use the JDBC driver to only send a quick query without browsing
> resultset and it take forever. For example:
>
> Statement stmt = connection.createStatement();
> ResultSet rs =stmt.executeQuery("select street from \"QCs_polyline\"");
> stmt.close();
>
> This takes 19 sec. Does I am missing something like a configuration on
> the driver? So far I was just testing PostGIS/PostgreSQL with tiny
> tables.
>

By default the JDBC driver will fetch the entire ResultSet before the
executeQuery call returns. If you don't want this behavior set the
fetchsize appropriately. See the following for more information:

http://jdbc.postgresql.org/documentation/81/query.html#query-with-cursor

Kris Jurka

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Oliver Jowett 2006-01-25 22:12:16 Re: Socket read fails
Previous Message Gilbert, Antoine 2006-01-25 19:51:24 strange problem