[postgis-users] strange jdbc problem
Gilbert, Antoine
AGilbert at korem.com
Wed Jan 25 13:37:46 PST 2006
A guy pointed me on how to resolve this kind of problem
Here are the explanations
"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."
http://jdbc.postgresql.org/documentation/81/query.html#query-with-cursor
All is ok now. It's a very strange default behavior in my own
opinion....
-----Original Message-----
From: Paul Ramsey [mailto:pramsey at refractions.net]
Sent: January 25, 2006 4:22 PM
To: PostGIS Users Discussion
Subject: Re: [postgis-users] strange jdbc problem
Antoine,
You need to use a forwardonly cursor if you want a fast return.
Otherwise the JDBC system is pulling the whole resultset into the
client side, for your use. This is a general postgresql jdbc issue,
not a postgis issue, check the jdbc documentation on the postgresql
site.
P.
On Jan 25, 2006, at 11:50 AM, Gilbert, Antoine wrote:
> Hi
>
>
> I have a single PostGIS table in PostgreSQL
>
>
> This table have 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.
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users
More information about the postgis-users
mailing list