RE: [INTERFACES] JDBC next() method

From: herouth maoz <herouth(at)oumail(dot)openu(dot)ac(dot)il>
To: Jon Barnett <jbarnett(at)pobox(dot)com>
Cc: "'pgsql-interfaces(at)hub(dot)org'" <pgsql-interfaces(at)hub(dot)org>
Subject: RE: [INTERFACES] JDBC next() method
Date: 1999-04-23 20:45:24
Message-ID: Pine.GSO.4.05_heb2.07.9904232340370.21845-100000@shaked.cc.openu.ac.il
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

On Sat, 24 Apr 1999, Jon Barnett wrote:

> The question is less one of "what is required to correctly interpret the result
> from the postgresql jdbc driver" and more a case of determining whether this
> result conforms to the jdbc api definitions.To re-phrase this; if I employed
> a different JDBC driver, would I obtain the same result? For after all, the
> goal of the JDBC layer is to provide a consistent interface, independent of the
> database to which you are connecting, particularly when you can late bind the
> driver (specify the driver you want to use at run-time).

The question here is not on the JDBC level. As far as JDBC is concerned,
the behaviour of the posgresql JDBC driver is conformant: In case no rows
are returned, next() will return false upon first call. In case a row is
returned, which contains a null value, next() will return true, the value
of the field is 0, and you test it for null otherwise.

No, the question is whether Postgres's behaviour - of returning a row with
a null field in case no rows fell into the WHERE category - is compatible
with other databases, or indeed with the SQL standard. I don't have the
standard in front of me at this moment. But you must understand that this
is how PostgreSQL behaves, no matter whether your frontend is in Java,
python, perl or C. It's not a question of JDBC.

Herouth

In response to

Browse pgsql-interfaces by date

  From Date Subject
Next Message Andrew Merrill 1999-04-23 20:53:25 problems with time zones in JDBC
Previous Message JT Kirkpatrick 1999-04-23 19:37:07 win98 odbc problem?