pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter T Mount <peter@retep.org.uk>
To: Kovacs Baldvin <kb136@hszk.bme.hu>
Cc: pgsql-interfaces@postgresql.org
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Q on JDBC's resultset
Date: Tue, 06 Feb 2001 05:21:11 -0500 (EST)
Message-ID: <981454871.3a7fd017dc11f@webmail.retep.org.uk> (raw)
In-Reply-To: <Pine.GSO.4.21.0102012132230.9884-100000@ural2>
References: <Pine.GSO.4.21.0102012132230.9884-100000@ural2>

Quoting Kovacs Baldvin <kb136@hszk.bme.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@retep.org.uk
PostgreSQL JDBC Driver: http://www.retep.org.uk/postgres/
RetepPDF PDF library for Java: http://www.retep.org.uk/pdf/



view thread (5+ messages)  latest in thread

Message-ID: <981454871.3a7fd017dc11f@webmail.retep.org.uk>
Permalink:  ../981454871.3a7fd017dc11f@webmail.retep.org.uk/
Also on:    postgresql.org/message-id/981454871.3a7fd017dc11f@webmail.retep.org.uk

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: peter@retep.org.uk, kb136@hszk.bme.hu, pgsql-jdbc@postgresql.org
  Subject: Re: Q on JDBC's resultset
  In-Reply-To: <981454871.3a7fd017dc11f@webmail.retep.org.uk>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox