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: 981454871.3a7fd017dc11f@webmail.retep.org.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces pgsql-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()
DatabaseMetaData.supportsSelectForUpdate()

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

--
Peter Mount peter(at)retep(dot)org(dot)uk
PostgreSQL JDBC Driver: http://www.retep.org.uk/postgres/
RetepPDF PDF library for Java: http://www.retep.org.uk/pdf/

In response to

Responses

Browse pgsql-interfaces by date

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

Browse pgsql-jdbc by date

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