Re: FW: Question about the postgres resultset implementation - Mailing list pgsql-jdbc

From Kris Jurka
Subject Re: FW: Question about the postgres resultset implementation
Date
Msg-id Pine.BSO.4.56.0410131205480.22508@leary.csoft.net
Whole thread Raw
In response to FW: Question about the postgres resultset implementation  ("Tornroth, Phill" <ptornroth@intellidot.net>)
List pgsql-jdbc

On Wed, 13 Oct 2004, Tornroth, Phill wrote:

> I did some tinkering of my own and found that one of the problems with
> making the driver less cumbersome is the fact that findColumn() is currently
> case insensitive. I don't know if this is required by the jdbc spec, but it
> seems all the field names come back lower case (in the fields[] array), and
> so I could replace the implementation without understanding how to prevent
> the case of the field names from changing (changing from the case they were
> sent in as).

Case insensitivity is required.  Note that field names won't come back in
lowercase if they aren't created as lowercase.  Postgresql folds all
non-quoted identifiers to lower case, so you need to quote them to retain
case.

>
> At any rate, if case insensitivity could be thrown out then a very fast
> implementation could be worked out. As is, the following code was a marked
> improvement:

I believe Peter's suggestion was to use a hashmap to cache the
string->index mapping so that findColumn would only need to do the
equalsIgnoreCase on the first call of that string, meaning once per column
instead of for every call.

Kris Jurka

pgsql-jdbc by date:

Previous
From: Kris Jurka
Date:
Subject: Re: FW: Question about the postgres resultset implementation
Next
From: "Iain"
Date:
Subject: Re: tightening up on use of oid 0