Re: FW: Question about the postgres resultset implementation

Поиск
Список
Период
Сортировка
От Kris Jurka
Тема Re: FW: Question about the postgres resultset implementation
Дата
Msg-id Pine.BSO.4.56.0410131205480.22508@leary.csoft.net
обсуждение исходный текст
Ответ на FW: Question about the postgres resultset implementation  ("Tornroth, Phill" <ptornroth@intellidot.net>)
Список 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 по дате отправления:

Предыдущее
От: Kris Jurka
Дата:
Сообщение: Re: FW: Question about the postgres resultset implementation
Следующее
От: "Iain"
Дата:
Сообщение: Re: tightening up on use of oid 0