Skip site navigation (1) Skip section navigation (2)

Re: Q on JDBC's resultset

From: Peter T Mount <peter(at)retep(dot)org(dot)uk>
To: Kovacs Baldvin <kb136(at)hszk(dot)bme(dot)hu>
Cc: pgsql-interfaces(at)postgresql(dot)org, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Q on JDBC's resultset
Date: 2001-02-06 10:21:11
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-interfacespgsql-jdbc
Quoting Kovacs Baldvin <kb136(at)hszk(dot)bme(dot)hu>:

Redirecting to the JDBC list.

> Hello.
> I looked in the source and have the feeling that if I
> execute a SELECT statement, the whole resultset comes through
> the network in one large bundle. 
> Is it true?

Currently yes (although the same goes for other interfaces as well).

> It means that I cannot enable to use simple tablemodel and
> table on top of an sql query, since it would be too slow to
> download all of the data when opening it.

Work in progress, may get into 7.1 if time allows. Basically the idea is to 
have an optional ResultSet that implements the retrieve using a cursor.

> Anyway, how does the backend handles this? If I execute a query,
> it copies the result immediately to a separate place?? So for
> a SELECT *... query on a 2GB table results immediately in the
> occupance of an pther two gigs?

Possibly, although it may be inteligent enough to handle it differently 
(somebody correct me here).

> Lastly, does anyone plans to work on updatable cursors? I think
> that would make possibel to create read/write tablemodels in
> Java.

7.1 has the beginings of an UpdateableResultSet. When I can work out how to 
solve a few fundamental problems it shouldn't take long.

Here's a few questions for people to see if they can figure it out:

* How to detect what table a column belongs so. Required if the query was a 
join of 2 or more tables.

* How to detect if the query was on a view. Do we support updateable view's? 
(not tried it myself).

* How to detect if a column was a computed value (ie count(*) or col1+col2 etc).

There's probably more, but I can't think of them at the moment.

> p.s.: Does anyone knows if mysql supports updatable queries and
> complete jdbc?

Not sure about updateable queries, but there are not many drivers that support 
the complete jdbc.

PS: Updateable ResultSet's are not actually required for JDBC Compliance. 
Technically if the database or driver cannot support it, it is supposed to 
though an SQLException (and also say so in DatabaseMetaData methods) that it 
doesn't support it.

That's why there are methods in DatabaseMetaData that currently return false 
because we don't support it (yet).

ie: DatabaseMetaData.supportsPositionedUpdate()

Technically (by the specs) you should check DatabaseMetaData first to see if a 
feature is implemented, and then your code should handle either senario.

Were more compliant than most of the others ;-)


Peter Mount peter(at)retep(dot)org(dot)uk
PostgreSQL JDBC Driver:
RetepPDF PDF library for Java:

In response to


pgsql-interfaces by date

Next:From: Kassu ValtakariDate: 2001-02-06 11:46:23
Subject: Re: Asychronous Query Processing via Libpq
Previous:From: Jean-Francois BurdetDate: 2001-02-06 08:47:00
Subject: Re: different methods to transfer data

pgsql-jdbc by date

Next:From: Pete FormanDate: 2001-02-06 12:49:15
Subject: Archives of this list
Previous:From: Peter T MountDate: 2001-02-06 10:07:37
Subject: RE: GIS-type databases using PostgreSQL

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group